Moonrise face
This commit is contained in:
427
movement/watch_faces/complication/moonrise_face.c
Normal file
427
movement/watch_faces/complication/moonrise_face.c
Normal file
@@ -0,0 +1,427 @@
|
||||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2025 hueso
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "moonrise_face.h"
|
||||
#include "sunrise_sunset_face.h"
|
||||
#include "watch.h"
|
||||
#include "watch_utility.h"
|
||||
#include "moonrise.h"
|
||||
|
||||
#if __EMSCRIPTEN__
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
static const uint8_t _location_count = sizeof(longLatPresets) / sizeof(long_lat_presets_t);
|
||||
|
||||
static void _moonrise_set_expiration(moonrise_state_t *state, watch_date_time next_rise_set) {
|
||||
uint32_t timestamp = watch_utility_date_time_to_unix_time(next_rise_set, 0);
|
||||
state->rise_set_expires = watch_utility_date_time_from_unix_time(timestamp + 60, 0);
|
||||
}
|
||||
|
||||
static void _moonrise_face_update(movement_settings_t *settings, moonrise_state_t *state) {
|
||||
char buf[14];
|
||||
bool show_next_match = false;
|
||||
movement_location_t movement_location;
|
||||
|
||||
if (state->longLatToUse == 0 || _location_count <= 1)
|
||||
movement_location = (movement_location_t) watch_get_backup_data(1);
|
||||
else{
|
||||
movement_location.bit.latitude = longLatPresets[state->longLatToUse].latitude;
|
||||
movement_location.bit.longitude = longLatPresets[state->longLatToUse].longitude;
|
||||
}
|
||||
|
||||
if (movement_location.reg == 0) {
|
||||
watch_display_string("MR no Loc", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
watch_date_time date_time = watch_rtc_get_date_time(); // the current local date / time
|
||||
watch_date_time scratch_time; // scratchpad, contains different values at different times
|
||||
scratch_time.reg = date_time.reg;
|
||||
|
||||
// Weird quirky unsigned things were happening when I tried to cast these directly to doubles below.
|
||||
// it looks redundant, but extracting them to local int16's seemed to fix it.
|
||||
int16_t lat_centi = (int16_t)movement_location.bit.latitude;
|
||||
int16_t lon_centi = (int16_t)movement_location.bit.longitude;
|
||||
|
||||
double lat = (double)lat_centi / 100.0;
|
||||
double lon = (double)lon_centi / 100.0;
|
||||
|
||||
time_t t = watch_utility_date_time_to_unix_time(scratch_time, movement_timezone_offsets[settings->bit.time_zone] * 60);
|
||||
MoonRise mr = MoonRise_calculate(lat, lon, t);
|
||||
if(mr.isVisible)
|
||||
watch_set_indicator(WATCH_INDICATOR_LAP);
|
||||
else
|
||||
watch_clear_indicator(WATCH_INDICATOR_LAP);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
t = watch_utility_date_time_to_unix_time(scratch_time, movement_timezone_offsets[settings->bit.time_zone] * 60);
|
||||
|
||||
MoonRise mr = MoonRise_calculate(lat, lon, t);
|
||||
|
||||
if (!mr.hasRise && !mr.hasSet) {
|
||||
watch_clear_colon();
|
||||
watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||
watch_clear_indicator(WATCH_INDICATOR_24H);
|
||||
sprintf(buf, "MR%2d none ", scratch_time.unit.day);
|
||||
watch_display_string(buf, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
watch_set_colon();
|
||||
if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero)
|
||||
watch_set_indicator(WATCH_INDICATOR_24H);
|
||||
|
||||
scratch_time = watch_utility_date_time_from_unix_time(mr.riseTime, movement_timezone_offsets[settings->bit.time_zone] * 60);
|
||||
|
||||
if (date_time.reg < scratch_time.reg) _moonrise_set_expiration(state, scratch_time);
|
||||
|
||||
if (date_time.reg < scratch_time.reg || show_next_match) {
|
||||
if (state->rise_index == 0 || show_next_match) {
|
||||
bool set_leading_zero = false;
|
||||
if (!settings->bit.clock_mode_24h) {
|
||||
if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM);
|
||||
else watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||
} else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
|
||||
set_leading_zero = true;
|
||||
}
|
||||
sprintf(buf, "M %2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
|
||||
watch_display_string(buf, 0);
|
||||
watch_set_pixel(0,11);
|
||||
if (set_leading_zero)
|
||||
watch_display_string("0", 4);
|
||||
return;
|
||||
} else {
|
||||
show_next_match = true;
|
||||
}
|
||||
}
|
||||
|
||||
scratch_time = watch_utility_date_time_from_unix_time(mr.setTime, movement_timezone_offsets[settings->bit.time_zone] * 60);
|
||||
|
||||
if (date_time.reg < scratch_time.reg) _moonrise_set_expiration(state, scratch_time);
|
||||
|
||||
if (date_time.reg < scratch_time.reg || show_next_match) {
|
||||
if (state->rise_index == 0 || show_next_match) {
|
||||
bool set_leading_zero = false;
|
||||
if (!settings->bit.clock_mode_24h) {
|
||||
if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM);
|
||||
else watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||
} else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
|
||||
set_leading_zero = true;
|
||||
}
|
||||
sprintf(buf, "M %2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute, longLatPresets[state->longLatToUse].name);
|
||||
watch_display_string(buf, 0);
|
||||
watch_set_pixel(2,11);
|
||||
if (set_leading_zero)
|
||||
watch_display_string("0", 4);
|
||||
return;
|
||||
} else {
|
||||
show_next_match = true;
|
||||
}
|
||||
}
|
||||
// it's after sunset. we need to display sunrise/sunset for tomorrow.
|
||||
uint32_t timestamp = watch_utility_date_time_to_unix_time(date_time, 0);
|
||||
timestamp += 86400;
|
||||
scratch_time = watch_utility_date_time_from_unix_time(timestamp, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static int16_t _moonrise_face_latlon_from_struct(moonrise_lat_lon_settings_t val) {
|
||||
int16_t retval = (val.sign ? -1 : 1) *
|
||||
(
|
||||
val.hundreds * 10000 +
|
||||
val.tens * 1000 +
|
||||
val.ones * 100 +
|
||||
val.tenths * 10 +
|
||||
val.hundredths
|
||||
);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static moonrise_lat_lon_settings_t _moonrise_face_struct_from_latlon(int16_t val) {
|
||||
moonrise_lat_lon_settings_t retval;
|
||||
|
||||
retval.sign = val < 0;
|
||||
val = abs(val);
|
||||
retval.hundredths = val % 10;
|
||||
val /= 10;
|
||||
retval.tenths = val % 10;
|
||||
val /= 10;
|
||||
retval.ones = val % 10;
|
||||
val /= 10;
|
||||
retval.tens = val % 10;
|
||||
val /= 10;
|
||||
retval.hundreds = val % 10;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void _moonrise_face_update_location_register(moonrise_state_t *state) {
|
||||
if (state->location_changed) {
|
||||
movement_location_t movement_location;
|
||||
int16_t lat = _moonrise_face_latlon_from_struct(state->working_latitude);
|
||||
int16_t lon = _moonrise_face_latlon_from_struct(state->working_longitude);
|
||||
movement_location.bit.latitude = lat;
|
||||
movement_location.bit.longitude = lon;
|
||||
watch_store_backup_data(movement_location.reg, 1);
|
||||
state->location_changed = false;
|
||||
}
|
||||
}
|
||||
|
||||
static void _moonrise_face_update_settings_display(movement_event_t event, moonrise_state_t *state) {
|
||||
char buf[12];
|
||||
|
||||
switch (state->page) {
|
||||
case 0:
|
||||
return;
|
||||
case 1:
|
||||
sprintf(buf, "LA %c %04d", state->working_latitude.sign ? '-' : '+', abs(_moonrise_face_latlon_from_struct(state->working_latitude)));
|
||||
break;
|
||||
case 2:
|
||||
sprintf(buf, "LO %c%05d", state->working_longitude.sign ? '-' : '+', abs(_moonrise_face_latlon_from_struct(state->working_longitude)));
|
||||
break;
|
||||
}
|
||||
if (event.subsecond % 2) {
|
||||
buf[state->active_digit + 4] = ' ';
|
||||
}
|
||||
watch_display_string(buf, 0);
|
||||
}
|
||||
|
||||
static void _moonrise_face_advance_digit(moonrise_state_t *state) {
|
||||
state->location_changed = true;
|
||||
switch (state->page) {
|
||||
case 1: // latitude
|
||||
switch (state->active_digit) {
|
||||
case 0:
|
||||
state->working_latitude.sign++;
|
||||
break;
|
||||
case 1:
|
||||
// we skip this digit
|
||||
break;
|
||||
case 2:
|
||||
state->working_latitude.tens = (state->working_latitude.tens + 1) % 10;
|
||||
if (abs(_moonrise_face_latlon_from_struct(state->working_latitude)) > 9000) {
|
||||
// prevent latitude from going over ±90.
|
||||
// TODO: perform these checks when advancing the digit?
|
||||
state->working_latitude.ones = 0;
|
||||
state->working_latitude.tenths = 0;
|
||||
state->working_latitude.hundredths = 0;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
state->working_latitude.ones = (state->working_latitude.ones + 1) % 10;
|
||||
if (abs(_moonrise_face_latlon_from_struct(state->working_latitude)) > 9000) state->working_latitude.ones = 0;
|
||||
break;
|
||||
case 4:
|
||||
state->working_latitude.tenths = (state->working_latitude.tenths + 1) % 10;
|
||||
if (abs(_moonrise_face_latlon_from_struct(state->working_latitude)) > 9000) state->working_latitude.tenths = 0;
|
||||
break;
|
||||
case 5:
|
||||
state->working_latitude.hundredths = (state->working_latitude.hundredths + 1) % 10;
|
||||
if (abs(_moonrise_face_latlon_from_struct(state->working_latitude)) > 9000) state->working_latitude.hundredths = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2: // longitude
|
||||
switch (state->active_digit) {
|
||||
case 0:
|
||||
state->working_longitude.sign++;
|
||||
break;
|
||||
case 1:
|
||||
state->working_longitude.hundreds = (state->working_longitude.hundreds + 1) % 10;
|
||||
if (abs(_moonrise_face_latlon_from_struct(state->working_longitude)) > 18000) {
|
||||
// prevent longitude from going over ±180
|
||||
state->working_longitude.tens = 8;
|
||||
state->working_longitude.ones = 0;
|
||||
state->working_longitude.tenths = 0;
|
||||
state->working_longitude.hundredths = 0;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
state->working_longitude.tens = (state->working_longitude.tens + 1) % 10;
|
||||
if (abs(_moonrise_face_latlon_from_struct(state->working_longitude)) > 18000) state->working_longitude.tens = 0;
|
||||
break;
|
||||
case 3:
|
||||
state->working_longitude.ones = (state->working_longitude.ones + 1) % 10;
|
||||
if (abs(_moonrise_face_latlon_from_struct(state->working_longitude)) > 18000) state->working_longitude.ones = 0;
|
||||
break;
|
||||
case 4:
|
||||
state->working_longitude.tenths = (state->working_longitude.tenths + 1) % 10;
|
||||
if (abs(_moonrise_face_latlon_from_struct(state->working_longitude)) > 18000) state->working_longitude.tenths = 0;
|
||||
break;
|
||||
case 5:
|
||||
state->working_longitude.hundredths = (state->working_longitude.hundredths + 1) % 10;
|
||||
if (abs(_moonrise_face_latlon_from_struct(state->working_longitude)) > 18000) state->working_longitude.hundredths = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void moonrise_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
(void) watch_face_index;
|
||||
if (*context_ptr == NULL) {
|
||||
*context_ptr = malloc(sizeof(moonrise_state_t));
|
||||
memset(*context_ptr, 0, sizeof(moonrise_state_t));
|
||||
}
|
||||
}
|
||||
|
||||
void moonrise_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
if (watch_tick_animation_is_running()) watch_stop_tick_animation();
|
||||
|
||||
#if __EMSCRIPTEN__
|
||||
int16_t browser_lat = EM_ASM_INT({
|
||||
return lat;
|
||||
});
|
||||
int16_t browser_lon = EM_ASM_INT({
|
||||
return lon;
|
||||
});
|
||||
if ((watch_get_backup_data(1) == 0) && (browser_lat || browser_lon)) {
|
||||
movement_location_t browser_loc;
|
||||
browser_loc.bit.latitude = browser_lat;
|
||||
browser_loc.bit.longitude = browser_lon;
|
||||
watch_store_backup_data(browser_loc.reg, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
moonrise_state_t *state = (moonrise_state_t *)context;
|
||||
movement_location_t movement_location = (movement_location_t) watch_get_backup_data(1);
|
||||
state->working_latitude = _moonrise_face_struct_from_latlon(movement_location.bit.latitude);
|
||||
state->working_longitude = _moonrise_face_struct_from_latlon(movement_location.bit.longitude);
|
||||
}
|
||||
|
||||
bool moonrise_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
moonrise_state_t *state = (moonrise_state_t *)context;
|
||||
|
||||
switch (event.event_type) {
|
||||
case EVENT_ACTIVATE:
|
||||
_moonrise_face_update(settings, state);
|
||||
break;
|
||||
case EVENT_LOW_ENERGY_UPDATE:
|
||||
case EVENT_TICK:
|
||||
if (state->page == 0) {
|
||||
// if entering low energy mode, start tick animation
|
||||
if (event.event_type == EVENT_LOW_ENERGY_UPDATE && !watch_tick_animation_is_running()) watch_start_tick_animation(1000);
|
||||
// check if we need to update the display
|
||||
watch_date_time date_time = watch_rtc_get_date_time();
|
||||
if (date_time.reg >= state->rise_set_expires.reg) {
|
||||
// and on the off chance that this happened before EVENT_TIMEOUT snapped us back to rise/set 0, go back now
|
||||
state->rise_index = 0;
|
||||
_moonrise_face_update(settings, state);
|
||||
}
|
||||
} else {
|
||||
_moonrise_face_update_settings_display(event, state);
|
||||
}
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_DOWN:
|
||||
if (state->page) {
|
||||
state->active_digit++;
|
||||
if (state->page == 1 && state->active_digit == 1) state->active_digit++; // max latitude is +- 90, no hundreds place
|
||||
if (state->active_digit > 5) {
|
||||
state->active_digit = 0;
|
||||
state->page = (state->page + 1) % 3;
|
||||
_moonrise_face_update_location_register(state);
|
||||
}
|
||||
_moonrise_face_update_settings_display(event, context);
|
||||
} else if (_location_count <= 1) {
|
||||
movement_illuminate_led();
|
||||
}
|
||||
if (state->page == 0) {
|
||||
movement_request_tick_frequency(1);
|
||||
_moonrise_face_update(settings, state);
|
||||
}
|
||||
break;
|
||||
case EVENT_LIGHT_LONG_PRESS:
|
||||
if (_location_count <= 1) break;
|
||||
else if (!state->page) movement_illuminate_led();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
if (state->page == 0 && _location_count > 1) {
|
||||
state->longLatToUse = (state->longLatToUse + 1) % _location_count;
|
||||
_moonrise_face_update(settings, state);
|
||||
}
|
||||
break;
|
||||
case EVENT_ALARM_BUTTON_UP:
|
||||
if (state->page) {
|
||||
_moonrise_face_advance_digit(state);
|
||||
_moonrise_face_update_settings_display(event, context);
|
||||
} else {
|
||||
state->rise_index = (state->rise_index + 1) % 2;
|
||||
_moonrise_face_update(settings, state);
|
||||
}
|
||||
break;
|
||||
case EVENT_ALARM_LONG_PRESS:
|
||||
if (state->page == 0) {
|
||||
if (state->longLatToUse != 0) {
|
||||
state->longLatToUse = 0;
|
||||
_moonrise_face_update(settings, state);
|
||||
break;
|
||||
}
|
||||
state->page++;
|
||||
state->active_digit = 0;
|
||||
watch_clear_display();
|
||||
movement_request_tick_frequency(4);
|
||||
_moonrise_face_update_settings_display(event, context);
|
||||
}
|
||||
else {
|
||||
state->active_digit = 0;
|
||||
state->page = 0;
|
||||
_moonrise_face_update_location_register(state);
|
||||
_moonrise_face_update(settings, state);
|
||||
}
|
||||
break;
|
||||
case EVENT_TIMEOUT:
|
||||
if (watch_get_backup_data(1) == 0) {
|
||||
// if no location set, return home
|
||||
movement_move_to_face(0);
|
||||
} else if (state->page || state->rise_index) {
|
||||
// otherwise on timeout, exit settings mode and return to the next sunrise or sunset
|
||||
state->page = 0;
|
||||
state->rise_index = 0;
|
||||
movement_request_tick_frequency(1);
|
||||
_moonrise_face_update(settings, state);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return movement_default_loop_handler(event, settings);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void moonrise_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
moonrise_state_t *state = (moonrise_state_t *)context;
|
||||
state->page = 0;
|
||||
state->active_digit = 0;
|
||||
state->rise_index = 0;
|
||||
_moonrise_face_update_location_register(state);
|
||||
}
|
||||
90
movement/watch_faces/complication/moonrise_face.h
Normal file
90
movement/watch_faces/complication/moonrise_face.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2022 Joey Castillo
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MOONRISE_FACE_H_
|
||||
#define MOONRISE_FACE_H_
|
||||
|
||||
/*
|
||||
* SUNRISE & SUNSET FACE
|
||||
*
|
||||
* The Sunrise/Sunset face is designed to display the next sunrise or sunset
|
||||
* for a given location. It also functions as an interface for setting the
|
||||
* location register, which other watch faces can use for various purposes.
|
||||
*
|
||||
* Refer to the wiki for usage instructions:
|
||||
* https://www.sensorwatch.net/docs/watchfaces/complication/#sunrisesunset
|
||||
*/
|
||||
|
||||
#include "movement.h"
|
||||
|
||||
typedef struct {
|
||||
uint8_t sign: 1; // 0-1
|
||||
uint8_t hundreds: 1; // 0-1, ignored for latitude
|
||||
uint8_t tens: 4; // 0-9 (must wrap at 10)
|
||||
uint8_t ones: 4; // 0-9 (must wrap at 10)
|
||||
uint8_t tenths: 4; // 0-9 (must wrap at 10)
|
||||
uint8_t hundredths: 4; // 0-9 (must wrap at 10)
|
||||
} moonrise_lat_lon_settings_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t page;
|
||||
uint8_t rise_index;
|
||||
uint8_t active_digit;
|
||||
bool location_changed;
|
||||
watch_date_time rise_set_expires;
|
||||
moonrise_lat_lon_settings_t working_latitude;
|
||||
moonrise_lat_lon_settings_t working_longitude;
|
||||
uint8_t longLatToUse;
|
||||
} moonrise_state_t;
|
||||
|
||||
void moonrise_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
|
||||
void moonrise_face_activate(movement_settings_t *settings, void *context);
|
||||
bool moonrise_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
|
||||
void moonrise_face_resign(movement_settings_t *settings, void *context);
|
||||
|
||||
#define moonrise_face ((const watch_face_t){ \
|
||||
moonrise_face_setup, \
|
||||
moonrise_face_activate, \
|
||||
moonrise_face_loop, \
|
||||
moonrise_face_resign, \
|
||||
NULL, \
|
||||
})
|
||||
|
||||
/*
|
||||
typedef struct {
|
||||
char name[2];
|
||||
int16_t latitude;
|
||||
int16_t longitude;
|
||||
} long_lat_presets_t;
|
||||
|
||||
|
||||
static const long_lat_presets_t longLatPresets[] =
|
||||
{
|
||||
{ .name = " "}, // Default, the long and lat get replaced by what's set in the watch
|
||||
// { .name = "Ny", .latitude = 4072, .longitude = -7401 }, // New York City, NY
|
||||
// { .name = "LA", .latitude = 3405, .longitude = -11824 }, // Los Angeles, CA
|
||||
// { .name = "dE", .latitude = 4221, .longitude = -8305 }, // Detroit, MI
|
||||
};
|
||||
*/
|
||||
#endif // MOONRISE_FACE_H_
|
||||
Reference in New Issue
Block a user