diff --git a/movement.c b/movement.c index b5bb640b..a702d353 100644 --- a/movement.c +++ b/movement.c @@ -103,10 +103,10 @@ static inline void _movement_disable_fast_tick_if_possible(void) { static void _movement_handle_background_tasks(void) { for(uint8_t i = 0; i < MOVEMENT_NUM_FACES; i++) { // For each face, if the watch face wants a background task... - if (watch_faces[i].wants_background_task != NULL && watch_faces[i].wants_background_task(&movement_state.settings, watch_face_contexts[i])) { + if (watch_faces[i].wants_background_task != NULL && watch_faces[i].wants_background_task(watch_face_contexts[i])) { // ...we give it one. pretty straightforward! movement_event_t background_event = { EVENT_BACKGROUND_TASK, 0 }; - watch_faces[i].loop(background_event, &movement_state.settings, watch_face_contexts[i]); + watch_faces[i].loop(background_event, watch_face_contexts[i]); } } movement_state.needs_background_tasks_handled = false; @@ -121,7 +121,7 @@ static void _movement_handle_scheduled_tasks(void) { if (scheduled_tasks[i].reg <= date_time.reg) { scheduled_tasks[i].reg = 0; movement_event_t background_event = { EVENT_BACKGROUND_TASK, 0 }; - watch_faces[i].loop(background_event, &movement_state.settings, watch_face_contexts[i]); + watch_faces[i].loop(background_event, watch_face_contexts[i]); // check if loop scheduled a new task if (scheduled_tasks[i].reg) { num_active_tasks++; @@ -181,9 +181,7 @@ void movement_force_led_off(void) { _movement_disable_fast_tick_if_possible(); } -bool movement_default_loop_handler(movement_event_t event, movement_settings_t *settings) { - (void)settings; - +bool movement_default_loop_handler(movement_event_t event) { switch (event.event_type) { case EVENT_MODE_BUTTON_UP: movement_move_to_next_face(); @@ -530,10 +528,10 @@ void app_setup(void) { movement_request_tick_frequency(1); for(uint8_t i = 0; i < MOVEMENT_NUM_FACES; i++) { - watch_faces[i].setup(&movement_state.settings, i, &watch_face_contexts[i]); + watch_faces[i].setup(i, &watch_face_contexts[i]); } - watch_faces[movement_state.current_face_idx].activate(&movement_state.settings, watch_face_contexts[movement_state.current_face_idx]); + watch_faces[movement_state.current_face_idx].activate(watch_face_contexts[movement_state.current_face_idx]); event.subsecond = 0; event.event_type = EVENT_ACTIVATE; } @@ -547,7 +545,7 @@ static void _sleep_mode_app_loop(void) { if (movement_state.needs_background_tasks_handled) _movement_handle_background_tasks(); event.event_type = EVENT_LOW_ENERGY_UPDATE; - watch_faces[movement_state.current_face_idx].loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_face_idx]); + watch_faces[movement_state.current_face_idx].loop(event, watch_face_contexts[movement_state.current_face_idx]); // if we need to wake immediately, do it! if (movement_state.needs_wake) return; @@ -564,13 +562,13 @@ bool app_loop(void) { // low note for nonzero case, high note for return to watch_face 0 watch_buzzer_play_note(movement_state.next_face_idx ? BUZZER_NOTE_C7 : BUZZER_NOTE_C8, 50); } - wf->resign(&movement_state.settings, watch_face_contexts[movement_state.current_face_idx]); + wf->resign(watch_face_contexts[movement_state.current_face_idx]); movement_state.current_face_idx = movement_state.next_face_idx; // we have just updated the face idx, so we must recache the watch face pointer. wf = &watch_faces[movement_state.current_face_idx]; watch_clear_display(); movement_request_tick_frequency(1); - wf->activate(&movement_state.settings, watch_face_contexts[movement_state.current_face_idx]); + wf->activate(watch_face_contexts[movement_state.current_face_idx]); event.subsecond = 0; event.event_type = EVENT_ACTIVATE; movement_state.watch_face_changed = false; @@ -619,7 +617,7 @@ bool app_loop(void) { if (event.event_type) { event.subsecond = movement_state.subsecond; // the first trip through the loop overrides the can_sleep state - can_sleep = wf->loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_face_idx]); + can_sleep = wf->loop(event, watch_face_contexts[movement_state.current_face_idx]); // Keep light on if user is still interacting with the watch. if (movement_state.light_ticks > 0) { @@ -646,7 +644,7 @@ bool app_loop(void) { // first trip | can sleep | cannot sleep | can sleep | cannot sleep // second trip | can sleep | cannot sleep | cannot sleep | can sleep // && | can sleep | cannot sleep | cannot sleep | cannot sleep - bool can_sleep2 = wf->loop(event, &movement_state.settings, watch_face_contexts[movement_state.current_face_idx]); + bool can_sleep2 = wf->loop(event, watch_face_contexts[movement_state.current_face_idx]); can_sleep = can_sleep && can_sleep2; event.event_type = EVENT_NONE; } diff --git a/movement.h b/movement.h index c9128871..6b54380f 100644 --- a/movement.h +++ b/movement.h @@ -154,9 +154,6 @@ extern const char movement_valid_position_1_chars[]; * like configuring a pin mode or a peripheral, you may want to do that here too. * This function will be called again after waking from sleep mode, since sleep mode disables all * of the device's pins and peripherals. - * @param settings A pointer to the global Movement settings. You can use this to inform how you present your - * display to the user (i.e. taking into account whether they have silenced the buttons, or if - * they prefer 12 or 24-hour mode). You can also change these settings if you like. * @param watch_face_index The index of this watch face in the global array of watch faces; 0 is the first face, * 1 is the second, etc. You may stash this value in your context if you wish to reference * it later; your watch face's index is set at launch and will not change. @@ -166,7 +163,7 @@ extern const char movement_valid_position_1_chars[]; * data required for your watch face. * */ -typedef void (*watch_face_setup)(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); +typedef void (*watch_face_setup)(uint8_t watch_face_index, void ** context_ptr); /** @brief Prepare to go on-screen. * @details This function is called just before your watch enters the foreground. If your watch face has any @@ -174,11 +171,10 @@ typedef void (*watch_face_setup)(movement_settings_t *settings, uint8_t watch_fa * watch face depends on data from a peripheral (like an I2C sensor), you will likely want to enable * that peripheral here. In addition, if your watch face requires an update frequncy other than 1 Hz, * you may want to request that here using the movement_request_tick_frequency function. - * @param settings A pointer to the global Movement settings. @see watch_face_setup. * @param context A pointer to your watch face's context. @see watch_face_setup. * */ -typedef void (*watch_face_activate)(movement_settings_t *settings, void *context); +typedef void (*watch_face_activate)(void *context); /** @brief Handle events and update the display. * @details This function is called in response to an event. You should set up a switch statement that handles, @@ -191,7 +187,6 @@ typedef void (*watch_face_activate)(movement_settings_t *settings, void *context * fail to do this, the user will become stuck on your watch face. * @param event A struct containing information about the event, including its type. @see movement_event_type_t * for a list of all possible event types. - * @param settings A pointer to the global Movement settings. @see watch_face_setup. * @param context A pointer to your application's context. @see watch_face_setup. * @return true if your watch face is prepared for the system to enter STANDBY mode; false to keep the system awake. * You should almost always return true. @@ -211,16 +206,15 @@ typedef void (*watch_face_activate)(movement_settings_t *settings, void *context unlikely the user is wearing or looking at the watch. EVENT_BACKGROUND_TASK is also a special case. @see watch_face_wants_background_task for details. */ -typedef bool (*watch_face_loop)(movement_event_t event, movement_settings_t *settings, void *context); +typedef bool (*watch_face_loop)(movement_event_t event, void *context); /** @brief Prepare to go off-screen. * @details This function is called before your watch face enters the background. If you requested a tick * frequency other than the standard 1 Hz, **you must call movement_request_tick_frequency(1) here** * to reset to 1 Hz. You should also disable any peripherals you enabled when you entered the foreground. - * @param settings A pointer to the global Movement settings. @see watch_face_setup. * @param context A pointer to your application's context. @see watch_face_setup. */ -typedef void (*watch_face_resign)(movement_settings_t *settings, void *context); +typedef void (*watch_face_resign)(void *context); /** @brief OPTIONAL. Request an opportunity to run a background task. * @details Most apps will not need this function, but if you provide it, Movement will call it once per minute in @@ -240,11 +234,10 @@ typedef void (*watch_face_resign)(movement_settings_t *settings, void *context); * - If your background task involves an external pin or peripheral, request background tasks no more than once per hour. * - If you need to enable a pin or a peripheral to perform your task, return it to its original state afterwards. * - * @param settings A pointer to the global Movement settings. @see watch_face_setup. * @param context A pointer to your application's context. @see watch_face_setup. * @return true to request a background task; false otherwise. */ -typedef bool (*watch_face_wants_background_task)(movement_settings_t *settings, void *context); +typedef bool (*watch_face_wants_background_task)(void *context); typedef struct { watch_face_setup setup; @@ -301,7 +294,7 @@ typedef struct { void movement_move_to_face(uint8_t watch_face_index); void movement_move_to_next_face(void); -bool movement_default_loop_handler(movement_event_t event, movement_settings_t *settings); +bool movement_default_loop_handler(movement_event_t event); void movement_illuminate_led(void); void movement_force_led_on(uint8_t red, uint8_t green, uint8_t blue); diff --git a/movement/template/template.c b/movement/template/template.c index fe2723b8..68405ec0 100644 --- a/movement/template/template.c +++ b/movement/template/template.c @@ -26,8 +26,7 @@ #include #include "<#watch_face_name#>_face.h" -void <#watch_face_name#>_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void <#watch_face_name#>_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(<#watch_face_name#>_state_t)); @@ -37,14 +36,13 @@ void <#watch_face_name#>_face_setup(movement_settings_t *settings, uint8_t watch // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void <#watch_face_name#>_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void <#watch_face_name#>_face_activate(void *context) { <#watch_face_name#>_state_t *state = (<#watch_face_name#>_state_t *)context; // Handle any tasks related to your watch face coming on screen. } -bool <#watch_face_name#>_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool <#watch_face_name#>_face_loop(movement_event_t event, void *context) { <#watch_face_name#>_state_t *state = (<#watch_face_name#>_state_t *)context; switch (event.event_type) { @@ -79,7 +77,7 @@ bool <#watch_face_name#>_face_loop(movement_event_t event, movement_settings_t * // * EVENT_MODE_BUTTON_UP moves to the next watch face in the list // * EVENT_MODE_LONG_PRESS returns to the first watch face (or skips to the secondary watch face, if configured) // You can override any of these behaviors by adding a case for these events to this switch statement. - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } // return true if the watch can enter standby mode. Generally speaking, you should always return true. @@ -91,8 +89,7 @@ bool <#watch_face_name#>_face_loop(movement_event_t event, movement_settings_t * return true; } -void <#watch_face_name#>_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void <#watch_face_name#>_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/template/template.h b/movement/template/template.h index be88e52a..7f2612c7 100644 --- a/movement/template/template.h +++ b/movement/template/template.h @@ -39,10 +39,10 @@ typedef struct { uint8_t unused; } <#watch_face_name#>_state_t; -void <#watch_face_name#>_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void <#watch_face_name#>_face_activate(movement_settings_t *settings, void *context); -bool <#watch_face_name#>_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void <#watch_face_name#>_face_resign(movement_settings_t *settings, void *context); +void <#watch_face_name#>_face_setup(uint8_t watch_face_index, void ** context_ptr); +void <#watch_face_name#>_face_activate(void *context); +bool <#watch_face_name#>_face_loop(movement_event_t event, void *context); +void <#watch_face_name#>_face_resign(void *context); #define <#watch_face_name#>_face ((const watch_face_t){ \ <#watch_face_name#>_face_setup, \ diff --git a/movement/watch_faces/clock/close_enough_clock_face.c b/movement/watch_faces/clock/close_enough_clock_face.c index 8aaf955a..91499af3 100644 --- a/movement/watch_faces/clock/close_enough_clock_face.c +++ b/movement/watch_faces/clock/close_enough_clock_face.c @@ -61,8 +61,7 @@ static void _update_alarm_indicator(bool settings_alarm_enabled, close_enough_cl }; } -void close_enough_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void close_enough_clock_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -70,7 +69,7 @@ void close_enough_clock_face_setup(movement_settings_t *settings, uint8_t watch_ } } -void close_enough_clock_face_activate(movement_settings_t *settings, void *context) { +void close_enough_clock_face_activate(void *context) { close_enough_clock_state_t *state = (close_enough_clock_state_t *)context; if (watch_tick_animation_is_running()) { @@ -89,7 +88,7 @@ void close_enough_clock_face_activate(movement_settings_t *settings, void *conte state->prev_min_checked = -1; } -bool close_enough_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool close_enough_clock_face_loop(movement_event_t event, void *context) { close_enough_clock_state_t *state = (close_enough_clock_state_t *)context; char buf[11]; @@ -221,13 +220,12 @@ bool close_enough_clock_face_loop(movement_event_t event, movement_settings_t *s break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void close_enough_clock_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void close_enough_clock_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/clock/close_enough_clock_face.h b/movement/watch_faces/clock/close_enough_clock_face.h index 736a6c66..e693043d 100644 --- a/movement/watch_faces/clock/close_enough_clock_face.h +++ b/movement/watch_faces/clock/close_enough_clock_face.h @@ -46,10 +46,10 @@ typedef struct { bool alarm_enabled; } close_enough_clock_state_t; -void close_enough_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void close_enough_clock_face_activate(movement_settings_t *settings, void *context); -bool close_enough_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void close_enough_clock_face_resign(movement_settings_t *settings, void *context); +void close_enough_clock_face_setup(uint8_t watch_face_index, void ** context_ptr); +void close_enough_clock_face_activate(void *context); +bool close_enough_clock_face_loop(movement_event_t event, void *context); +void close_enough_clock_face_resign(void *context); #define close_enough_clock_face ((const watch_face_t){ \ close_enough_clock_face_setup, \ diff --git a/movement/watch_faces/clock/day_night_percentage_face.c b/movement/watch_faces/clock/day_night_percentage_face.c index dd822ffd..4dc7fc47 100644 --- a/movement/watch_faces/clock/day_night_percentage_face.c +++ b/movement/watch_faces/clock/day_night_percentage_face.c @@ -55,8 +55,7 @@ static void recalculate(watch_date_time utc_now, day_night_percentage_state_t *s state->result = sun_rise_set(utc_now.unit.year + WATCH_RTC_REFERENCE_YEAR, utc_now.unit.month, utc_now.unit.day, lon, lat, &state->rise, &state->set); } -void day_night_percentage_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void day_night_percentage_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -67,12 +66,11 @@ void day_night_percentage_face_setup(movement_settings_t *settings, uint8_t watc } } -void day_night_percentage_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void day_night_percentage_face_activate(void *context) { (void) context; } -bool day_night_percentage_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool day_night_percentage_face_loop(movement_event_t event, void *context) { day_night_percentage_state_t *state = (day_night_percentage_state_t *)context; char buf[12]; @@ -126,14 +124,13 @@ bool day_night_percentage_face_loop(movement_event_t event, movement_settings_t break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void day_night_percentage_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void day_night_percentage_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/clock/day_night_percentage_face.h b/movement/watch_faces/clock/day_night_percentage_face.h index d172c748..01c94de7 100644 --- a/movement/watch_faces/clock/day_night_percentage_face.h +++ b/movement/watch_faces/clock/day_night_percentage_face.h @@ -49,10 +49,10 @@ typedef struct { double daylen; } day_night_percentage_state_t; -void day_night_percentage_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void day_night_percentage_face_activate(movement_settings_t *settings, void *context); -bool day_night_percentage_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void day_night_percentage_face_resign(movement_settings_t *settings, void *context); +void day_night_percentage_face_setup(uint8_t watch_face_index, void ** context_ptr); +void day_night_percentage_face_activate(void *context); +bool day_night_percentage_face_loop(movement_event_t event, void *context); +void day_night_percentage_face_resign(void *context); #define day_night_percentage_face ((const watch_face_t){ \ day_night_percentage_face_setup, \ diff --git a/movement/watch_faces/clock/decimal_time_face.c b/movement/watch_faces/clock/decimal_time_face.c index f0543298..238be986 100644 --- a/movement/watch_faces/clock/decimal_time_face.c +++ b/movement/watch_faces/clock/decimal_time_face.c @@ -29,10 +29,9 @@ -void decimal_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void decimal_time_face_setup(uint8_t watch_face_index, void ** context_ptr) { // These next two lines just silence the compiler warnings associated with unused parameters. // We have no use for the settings or the watch_face_index, so we make that explicit here. - (void) settings; (void) watch_face_index; (void) context_ptr; // At boot, context_ptr will be NULL indicating that we don't have anyplace to store our context. @@ -48,10 +47,9 @@ void decimal_time_face_setup(movement_settings_t *settings, uint8_t watch_face_i } -void decimal_time_face_activate(movement_settings_t *settings, void *context) { +void decimal_time_face_activate(void *context) { // same as above: silence the warning, we don't need to check the settings. - (void) settings; // we do however need to set some things in our context. Here we cast it to the correct type... decimal_time_face_state_t *state = (decimal_time_face_state_t *)context; @@ -68,9 +66,8 @@ void decimal_time_face_activate(movement_settings_t *settings, void *context) { -bool decimal_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool decimal_time_face_loop(movement_event_t event, void *context) { - (void) settings; decimal_time_face_state_t *state = (decimal_time_face_state_t *)context; char buf[16]; @@ -147,7 +144,7 @@ bool decimal_time_face_loop(movement_event_t event, movement_settings_t *setting break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } @@ -155,10 +152,9 @@ bool decimal_time_face_loop(movement_event_t event, movement_settings_t *setting return true; } -void decimal_time_face_resign(movement_settings_t *settings, void *context) { +void decimal_time_face_resign(void *context) { // our watch face, like most watch faces, has nothing special to do when resigning. // there are no peripherals or sensors here to worry about turning off. - (void) settings; (void) context; } diff --git a/movement/watch_faces/clock/decimal_time_face.h b/movement/watch_faces/clock/decimal_time_face.h index 3d3a9138..e08c3da6 100644 --- a/movement/watch_faces/clock/decimal_time_face.h +++ b/movement/watch_faces/clock/decimal_time_face.h @@ -53,10 +53,10 @@ typedef struct { uint8_t features_to_show : 2 ; // what features are to be displayed? } decimal_time_face_state_t; -void decimal_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void decimal_time_face_activate(movement_settings_t *settings, void *context); -bool decimal_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void decimal_time_face_resign(movement_settings_t *settings, void *context); +void decimal_time_face_setup(uint8_t watch_face_index, void ** context_ptr); +void decimal_time_face_activate(void *context); +bool decimal_time_face_loop(movement_event_t event, void *context); +void decimal_time_face_resign(void *context); // void decimal_time_face_wants_background_task(); diff --git a/movement/watch_faces/clock/french_revolutionary_face.c b/movement/watch_faces/clock/french_revolutionary_face.c index 34ef6f1e..96f83f44 100644 --- a/movement/watch_faces/clock/french_revolutionary_face.c +++ b/movement/watch_faces/clock/french_revolutionary_face.c @@ -26,8 +26,7 @@ #include #include "french_revolutionary_face.h" -void french_revolutionary_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void french_revolutionary_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(french_revolutionary_state_t)); @@ -42,15 +41,14 @@ void french_revolutionary_face_setup(movement_settings_t *settings, uint8_t watc // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void french_revolutionary_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void french_revolutionary_face_activate(void *context) { french_revolutionary_state_t *state = (french_revolutionary_state_t *)context; // Handle any tasks related to your watch face coming on screen. state->colon_set_after_splash = false; } -bool french_revolutionary_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool french_revolutionary_face_loop(movement_event_t event, void *context) { french_revolutionary_state_t *state = (french_revolutionary_state_t *)context; char buf[11]; @@ -122,7 +120,7 @@ bool french_revolutionary_face_loop(movement_event_t event, movement_settings_t // * EVENT_MODE_BUTTON_UP moves to the next watch face in the list // * EVENT_MODE_LONG_PRESS returns to the first watch face (or skips to the secondary watch face, if configured) // You can override any of these behaviors by adding a case for these events to this switch statement. - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } // return true if the watch can enter standby mode. Generally speaking, you should always return true. @@ -134,8 +132,7 @@ bool french_revolutionary_face_loop(movement_event_t event, movement_settings_t return true; } -void french_revolutionary_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void french_revolutionary_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/clock/french_revolutionary_face.h b/movement/watch_faces/clock/french_revolutionary_face.h index 294f4226..60bacfc4 100644 --- a/movement/watch_faces/clock/french_revolutionary_face.h +++ b/movement/watch_faces/clock/french_revolutionary_face.h @@ -63,10 +63,10 @@ typedef struct { uint8_t hour : 5; // 0-10 } fr_decimal_time; -void french_revolutionary_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void french_revolutionary_face_activate(movement_settings_t *settings, void *context); -bool french_revolutionary_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void french_revolutionary_face_resign(movement_settings_t *settings, void *context); +void french_revolutionary_face_setup(uint8_t watch_face_index, void ** context_ptr); +void french_revolutionary_face_activate(void *context); +bool french_revolutionary_face_loop(movement_event_t event, void *context); +void french_revolutionary_face_resign(void *context); char fix_character_one(char digit); fr_decimal_time get_decimal_time(watch_date_time *date_time); void set_display_buffer(char *buf, french_revolutionary_state_t *state, fr_decimal_time *decimal_time, watch_date_time *date_time); diff --git a/movement/watch_faces/clock/mars_time_face.c b/movement/watch_faces/clock/mars_time_face.c index fba6e56b..f16e71f4 100644 --- a/movement/watch_faces/clock/mars_time_face.c +++ b/movement/watch_faces/clock/mars_time_face.c @@ -67,7 +67,7 @@ static void _h_to_hms(mars_clock_hms_t *date_time, double h) { date_time->second = round(seconds % 60); } -static void _update(movement_settings_t *settings, mars_time_state_t *state) { +static void _update(mars_time_state_t *state) { char buf[11]; watch_date_time date_time = watch_rtc_get_date_time(); uint32_t now = watch_utility_date_time_to_unix_time(date_time, movement_get_current_timezone_offset()); @@ -106,8 +106,7 @@ static void _update(movement_settings_t *settings, mars_time_state_t *state) { watch_display_string(buf, 0); } -void mars_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void mars_time_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(mars_time_state_t)); @@ -115,30 +114,29 @@ void mars_time_face_setup(movement_settings_t *settings, uint8_t watch_face_inde } } -void mars_time_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void mars_time_face_activate(void *context) { mars_time_state_t *state = (mars_time_state_t *)context; (void) state; } -bool mars_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool mars_time_face_loop(movement_event_t event, void *context) { mars_time_state_t *state = (mars_time_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: case EVENT_TICK: - _update(settings, state); + _update(state); break; case EVENT_LIGHT_BUTTON_UP: state->displaying_sol = !state->displaying_sol; - _update(settings, state); + _update(state); break; case EVENT_LIGHT_LONG_PRESS: movement_illuminate_led(); break; case EVENT_ALARM_BUTTON_UP: state->current_site = (state->current_site + 1) % MARS_TIME_NUM_SITES; - _update(settings, state); + _update(state); break; case EVENT_TIMEOUT: // TODO: make this lower power so we can avoid timeout @@ -152,15 +150,14 @@ bool mars_time_face_loop(movement_event_t event, movement_settings_t *settings, // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void mars_time_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void mars_time_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/clock/mars_time_face.h b/movement/watch_faces/clock/mars_time_face.h index 04917686..ddb43e64 100644 --- a/movement/watch_faces/clock/mars_time_face.h +++ b/movement/watch_faces/clock/mars_time_face.h @@ -67,10 +67,10 @@ typedef struct { bool displaying_sol; } mars_time_state_t; -void mars_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void mars_time_face_activate(movement_settings_t *settings, void *context); -bool mars_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void mars_time_face_resign(movement_settings_t *settings, void *context); +void mars_time_face_setup(uint8_t watch_face_index, void ** context_ptr); +void mars_time_face_activate(void *context); +bool mars_time_face_loop(movement_event_t event, void *context); +void mars_time_face_resign(void *context); #define mars_time_face ((const watch_face_t){ \ mars_time_face_setup, \ diff --git a/movement/watch_faces/clock/minimal_clock_face.c b/movement/watch_faces/clock/minimal_clock_face.c index 03ea6c41..2cb2bb0a 100644 --- a/movement/watch_faces/clock/minimal_clock_face.c +++ b/movement/watch_faces/clock/minimal_clock_face.c @@ -26,7 +26,7 @@ #include #include "minimal_clock_face.h" -static void _minimal_clock_face_update_display(movement_settings_t *settings) { +static void _minimal_clock_face_update_display() { watch_date_time date_time = watch_rtc_get_date_time(); char buffer[11]; @@ -40,8 +40,7 @@ static void _minimal_clock_face_update_display(movement_settings_t *settings) { watch_display_string(buffer, 4); } -void minimal_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void minimal_clock_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(minimal_clock_state_t)); @@ -51,24 +50,23 @@ void minimal_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_ // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void minimal_clock_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void minimal_clock_face_activate(void *context) { (void) context; // Handle any tasks related to your watch face coming on screen. watch_set_colon(); } -bool minimal_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool minimal_clock_face_loop(movement_event_t event, void *context) { (void) context; switch (event.event_type) { case EVENT_ACTIVATE: // Show your initial UI here. - _minimal_clock_face_update_display(settings); + _minimal_clock_face_update_display(); break; case EVENT_TICK: // If needed, update your display here. - _minimal_clock_face_update_display(settings); + _minimal_clock_face_update_display(); break; case EVENT_LIGHT_BUTTON_UP: // You can use the Light button for your own purposes. Note that by default, Movement will also @@ -88,7 +86,7 @@ bool minimal_clock_face_loop(movement_event_t event, movement_settings_t *settin // Avoid displaying fast-updating values like seconds, since the display won't update again for 60 seconds. // You should also consider starting the tick animation, to show the wearer that this is sleep mode: // watch_start_tick_animation(500); - _minimal_clock_face_update_display(settings); + _minimal_clock_face_update_display(); break; default: // Movement's default loop handler will step in for any cases you don't handle above: @@ -96,7 +94,7 @@ bool minimal_clock_face_loop(movement_event_t event, movement_settings_t *settin // * EVENT_MODE_BUTTON_UP moves to the next watch face in the list // * EVENT_MODE_LONG_PRESS returns to the first watch face (or skips to the secondary watch face, if configured) // You can override any of these behaviors by adding a case for these events to this switch statement. - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } // return true if the watch can enter standby mode. Generally speaking, you should always return true. @@ -108,8 +106,7 @@ bool minimal_clock_face_loop(movement_event_t event, movement_settings_t *settin return true; } -void minimal_clock_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void minimal_clock_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/clock/minimal_clock_face.h b/movement/watch_faces/clock/minimal_clock_face.h index d1f6ddf2..7c345e31 100644 --- a/movement/watch_faces/clock/minimal_clock_face.h +++ b/movement/watch_faces/clock/minimal_clock_face.h @@ -40,10 +40,10 @@ typedef struct { uint8_t unused; } minimal_clock_state_t; -void minimal_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void minimal_clock_face_activate(movement_settings_t *settings, void *context); -bool minimal_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void minimal_clock_face_resign(movement_settings_t *settings, void *context); +void minimal_clock_face_setup(uint8_t watch_face_index, void ** context_ptr); +void minimal_clock_face_activate(void *context); +bool minimal_clock_face_loop(movement_event_t event, void *context); +void minimal_clock_face_resign(void *context); #define minimal_clock_face ((const watch_face_t){ \ minimal_clock_face_setup, \ diff --git a/movement/watch_faces/clock/minute_repeater_decimal_face.c b/movement/watch_faces/clock/minute_repeater_decimal_face.c index 4cf09e43..79ba6175 100644 --- a/movement/watch_faces/clock/minute_repeater_decimal_face.c +++ b/movement/watch_faces/clock/minute_repeater_decimal_face.c @@ -66,8 +66,7 @@ static void _update_alarm_indicator(bool settings_alarm_enabled, minute_repeater else watch_clear_indicator(WATCH_INDICATOR_SIGNAL); } -void minute_repeater_decimal_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void minute_repeater_decimal_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -78,7 +77,7 @@ void minute_repeater_decimal_face_setup(movement_settings_t *settings, uint8_t w } } -void minute_repeater_decimal_face_activate(movement_settings_t *settings, void *context) { +void minute_repeater_decimal_face_activate(void *context) { minute_repeater_decimal_state_t *state = (minute_repeater_decimal_state_t *)context; if (watch_tick_animation_is_running()) watch_stop_tick_animation(); @@ -98,7 +97,7 @@ void minute_repeater_decimal_face_activate(movement_settings_t *settings, void * state->previous_date_time = 0xFFFFFFFF; } -bool minute_repeater_decimal_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool minute_repeater_decimal_face_loop(movement_event_t event, void *context) { minute_repeater_decimal_state_t *state = (minute_repeater_decimal_state_t *)context; char buf[11]; uint8_t pos; @@ -216,19 +215,17 @@ bool minute_repeater_decimal_face_loop(movement_event_t event, movement_settings break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void minute_repeater_decimal_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void minute_repeater_decimal_face_resign(void *context) { (void) context; } -bool minute_repeater_decimal_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool minute_repeater_decimal_face_wants_background_task(void *context) { minute_repeater_decimal_state_t *state = (minute_repeater_decimal_state_t *)context; if (!state->signal_enabled) return false; diff --git a/movement/watch_faces/clock/minute_repeater_decimal_face.h b/movement/watch_faces/clock/minute_repeater_decimal_face.h index 4bc9a8b6..b5090530 100644 --- a/movement/watch_faces/clock/minute_repeater_decimal_face.h +++ b/movement/watch_faces/clock/minute_repeater_decimal_face.h @@ -67,11 +67,11 @@ typedef struct { void mrd_play_hour_chime(void); void mrd_play_tens_chime(void); void mrd_play_minute_chime(void); -void minute_repeater_decimal_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void minute_repeater_decimal_face_activate(movement_settings_t *settings, void *context); -bool minute_repeater_decimal_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void minute_repeater_decimal_face_resign(movement_settings_t *settings, void *context); -bool minute_repeater_decimal_face_wants_background_task(movement_settings_t *settings, void *context); +void minute_repeater_decimal_face_setup(uint8_t watch_face_index, void ** context_ptr); +void minute_repeater_decimal_face_activate(void *context); +bool minute_repeater_decimal_face_loop(movement_event_t event, void *context); +void minute_repeater_decimal_face_resign(void *context); +bool minute_repeater_decimal_face_wants_background_task(void *context); #define minute_repeater_decimal_face ((const watch_face_t){ \ minute_repeater_decimal_face_setup, \ diff --git a/movement/watch_faces/clock/repetition_minute_face.c b/movement/watch_faces/clock/repetition_minute_face.c index 59110e61..48bfcdbf 100644 --- a/movement/watch_faces/clock/repetition_minute_face.c +++ b/movement/watch_faces/clock/repetition_minute_face.c @@ -51,8 +51,7 @@ static void _update_alarm_indicator(bool settings_alarm_enabled, repetition_minu else watch_clear_indicator(WATCH_INDICATOR_SIGNAL); } -void repetition_minute_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void repetition_minute_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -63,7 +62,7 @@ void repetition_minute_face_setup(movement_settings_t *settings, uint8_t watch_f } } -void repetition_minute_face_activate(movement_settings_t *settings, void *context) { +void repetition_minute_face_activate(void *context) { repetition_minute_state_t *state = (repetition_minute_state_t *)context; if (watch_tick_animation_is_running()) watch_stop_tick_animation(); @@ -83,7 +82,7 @@ void repetition_minute_face_activate(movement_settings_t *settings, void *contex state->previous_date_time = 0xFFFFFFFF; } -bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool repetition_minute_face_loop(movement_event_t event, void *context) { repetition_minute_state_t *state = (repetition_minute_state_t *)context; char buf[11]; uint8_t pos; @@ -199,19 +198,17 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void repetition_minute_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void repetition_minute_face_resign(void *context) { (void) context; } -bool repetition_minute_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool repetition_minute_face_wants_background_task(void *context) { repetition_minute_state_t *state = (repetition_minute_state_t *)context; if (!state->signal_enabled) return false; diff --git a/movement/watch_faces/clock/repetition_minute_face.h b/movement/watch_faces/clock/repetition_minute_face.h index 8c3100dd..3c631d6e 100644 --- a/movement/watch_faces/clock/repetition_minute_face.h +++ b/movement/watch_faces/clock/repetition_minute_face.h @@ -66,11 +66,11 @@ typedef struct { void play_hour_chime(void); void play_quarter_chime(void); void play_minute_chime(void); -void repetition_minute_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void repetition_minute_face_activate(movement_settings_t *settings, void *context); -bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void repetition_minute_face_resign(movement_settings_t *settings, void *context); -bool repetition_minute_face_wants_background_task(movement_settings_t *settings, void *context); +void repetition_minute_face_setup(uint8_t watch_face_index, void ** context_ptr); +void repetition_minute_face_activate(void *context); +bool repetition_minute_face_loop(movement_event_t event, void *context); +void repetition_minute_face_resign(void *context); +bool repetition_minute_face_wants_background_task(void *context); #define repetition_minute_face ((const watch_face_t){ \ repetition_minute_face_setup, \ diff --git a/movement/watch_faces/clock/simple_clock_bin_led_face.c b/movement/watch_faces/clock/simple_clock_bin_led_face.c index 4b2bea89..3729a50c 100644 --- a/movement/watch_faces/clock/simple_clock_bin_led_face.c +++ b/movement/watch_faces/clock/simple_clock_bin_led_face.c @@ -45,8 +45,7 @@ static void _display_left_aligned(uint8_t value) { } } -void simple_clock_bin_led_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void simple_clock_bin_led_face_setup(uint8_t watch_face_index, void ** context_ptr) { if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(simple_clock_bin_led_state_t)); memset(*context_ptr, 0, sizeof(simple_clock_bin_led_state_t)); @@ -55,7 +54,7 @@ void simple_clock_bin_led_face_setup(movement_settings_t *settings, uint8_t watc } } -void simple_clock_bin_led_face_activate(movement_settings_t *settings, void *context) { +void simple_clock_bin_led_face_activate(void *context) { simple_clock_bin_led_state_t *state = (simple_clock_bin_led_state_t *)context; if (watch_tick_animation_is_running()) watch_stop_tick_animation(); @@ -75,7 +74,7 @@ void simple_clock_bin_led_face_activate(movement_settings_t *settings, void *con state->previous_date_time = 0xFFFFFFFF; } -bool simple_clock_bin_led_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool simple_clock_bin_led_face_loop(movement_event_t event, void *context) { simple_clock_bin_led_state_t *state = (simple_clock_bin_led_state_t *)context; char buf[11]; uint8_t pos; @@ -200,19 +199,17 @@ bool simple_clock_bin_led_face_loop(movement_event_t event, movement_settings_t } break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void simple_clock_bin_led_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void simple_clock_bin_led_face_resign(void *context) { (void) context; } -bool simple_clock_bin_led_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool simple_clock_bin_led_face_wants_background_task(void *context) { simple_clock_bin_led_state_t *state = (simple_clock_bin_led_state_t *)context; if (!state->signal_enabled) return false; diff --git a/movement/watch_faces/clock/simple_clock_bin_led_face.h b/movement/watch_faces/clock/simple_clock_bin_led_face.h index 79c7c146..bff07589 100644 --- a/movement/watch_faces/clock/simple_clock_bin_led_face.h +++ b/movement/watch_faces/clock/simple_clock_bin_led_face.h @@ -64,11 +64,11 @@ typedef struct { uint8_t ticks; } simple_clock_bin_led_state_t; -void simple_clock_bin_led_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void simple_clock_bin_led_face_activate(movement_settings_t *settings, void *context); -bool simple_clock_bin_led_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void simple_clock_bin_led_face_resign(movement_settings_t *settings, void *context); -bool simple_clock_bin_led_face_wants_background_task(movement_settings_t *settings, void *context); +void simple_clock_bin_led_face_setup(uint8_t watch_face_index, void ** context_ptr); +void simple_clock_bin_led_face_activate(void *context); +bool simple_clock_bin_led_face_loop(movement_event_t event, void *context); +void simple_clock_bin_led_face_resign(void *context); +bool simple_clock_bin_led_face_wants_background_task(void *context); #define simple_clock_bin_led_face ((const watch_face_t){ \ simple_clock_bin_led_face_setup, \ diff --git a/movement/watch_faces/clock/weeknumber_clock_face.c b/movement/watch_faces/clock/weeknumber_clock_face.c index 3eb3e5b6..90c909a9 100644 --- a/movement/watch_faces/clock/weeknumber_clock_face.c +++ b/movement/watch_faces/clock/weeknumber_clock_face.c @@ -33,8 +33,7 @@ static void _update_alarm_indicator(bool settings_alarm_enabled, weeknumber_cloc else watch_clear_indicator(WATCH_INDICATOR_SIGNAL); } -void weeknumber_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void weeknumber_clock_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -45,7 +44,7 @@ void weeknumber_clock_face_setup(movement_settings_t *settings, uint8_t watch_fa } } -void weeknumber_clock_face_activate(movement_settings_t *settings, void *context) { +void weeknumber_clock_face_activate(void *context) { weeknumber_clock_state_t *state = (weeknumber_clock_state_t *)context; if (watch_tick_animation_is_running()) watch_stop_tick_animation(); @@ -65,7 +64,7 @@ void weeknumber_clock_face_activate(movement_settings_t *settings, void *context state->previous_date_time = 0xFFFFFFFF; } -bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool weeknumber_clock_face_loop(movement_event_t event, void *context) { weeknumber_clock_state_t *state = (weeknumber_clock_state_t *)context; char buf[11]; uint8_t pos; @@ -133,20 +132,18 @@ bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *set movement_play_signal(); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void weeknumber_clock_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void weeknumber_clock_face_resign(void *context) { (void) context; } -bool weeknumber_clock_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool weeknumber_clock_face_wants_background_task(void *context) { weeknumber_clock_state_t *state = (weeknumber_clock_state_t *)context; if (!state->signal_enabled) return false; diff --git a/movement/watch_faces/clock/weeknumber_clock_face.h b/movement/watch_faces/clock/weeknumber_clock_face.h index ec619427..d74da487 100644 --- a/movement/watch_faces/clock/weeknumber_clock_face.h +++ b/movement/watch_faces/clock/weeknumber_clock_face.h @@ -44,11 +44,11 @@ typedef struct { bool alarm_enabled; } weeknumber_clock_state_t; -void weeknumber_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void weeknumber_clock_face_activate(movement_settings_t *settings, void *context); -bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void weeknumber_clock_face_resign(movement_settings_t *settings, void *context); -bool weeknumber_clock_face_wants_background_task(movement_settings_t *settings, void *context); +void weeknumber_clock_face_setup(uint8_t watch_face_index, void ** context_ptr); +void weeknumber_clock_face_activate(void *context); +bool weeknumber_clock_face_loop(movement_event_t event, void *context); +void weeknumber_clock_face_resign(void *context); +bool weeknumber_clock_face_wants_background_task(void *context); #define weeknumber_clock_face ((const watch_face_t){ \ weeknumber_clock_face_setup, \ diff --git a/movement/watch_faces/clock/world_clock2_face.c b/movement/watch_faces/clock/world_clock2_face.c index ead219af..22ae2024 100644 --- a/movement/watch_faces/clock/world_clock2_face.c +++ b/movement/watch_faces/clock/world_clock2_face.c @@ -121,9 +121,8 @@ static void beep_disable() { watch_buzzer_play_note(BUZZER_NOTE_G7, 75); } -void world_clock2_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) +void world_clock2_face_setup(uint8_t watch_face_index, void **context_ptr) { - (void) settings; (void) watch_face_index; if (*context_ptr == NULL) { @@ -136,9 +135,8 @@ void world_clock2_face_setup(movement_settings_t *settings, uint8_t watch_face_i } } -void world_clock2_face_activate(movement_settings_t *settings, void *context) +void world_clock2_face_activate(void *context) { - (void) settings; world_clock2_state_t *state = (world_clock2_state_t *) context; if (watch_tick_animation_is_running()) @@ -157,7 +155,7 @@ void world_clock2_face_activate(movement_settings_t *settings, void *context) refresh_face = true; } -static bool mode_display(movement_event_t event, movement_settings_t *settings, world_clock2_state_t *state) +static bool mode_display(movement_event_t event, world_clock2_state_t *state) { char buf[11]; uint8_t pos; @@ -260,13 +258,13 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings, movement_move_to_next_face(); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -static bool mode_settings(movement_event_t event, movement_settings_t *settings, world_clock2_state_t *state) +static bool mode_settings(movement_event_t event, world_clock2_state_t *state) { char buf[11]; int8_t hours, minutes; @@ -352,26 +350,25 @@ static bool mode_settings(movement_event_t event, movement_settings_t *settings, movement_move_to_next_face(); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -bool world_clock2_face_loop(movement_event_t event, movement_settings_t *settings, void *context) +bool world_clock2_face_loop(movement_event_t event, void *context) { world_clock2_state_t *state = (world_clock2_state_t *) context; switch (state->current_mode) { case WORLD_CLOCK2_MODE_DISPLAY: - return mode_display(event, settings, state); + return mode_display(event, state); case WORLD_CLOCK2_MODE_SETTINGS: - return mode_settings(event, settings, state); + return mode_settings(event, state); } return false; } -void world_clock2_face_resign(movement_settings_t *settings, void *context) +void world_clock2_face_resign(void *context) { - (void) settings; (void) context; } diff --git a/movement/watch_faces/clock/world_clock2_face.h b/movement/watch_faces/clock/world_clock2_face.h index 0baac212..bd1ac691 100644 --- a/movement/watch_faces/clock/world_clock2_face.h +++ b/movement/watch_faces/clock/world_clock2_face.h @@ -106,10 +106,10 @@ typedef struct { uint32_t previous_date_time; } world_clock2_state_t; -void world_clock2_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr); -void world_clock2_face_activate(movement_settings_t *settings, void *context); -bool world_clock2_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void world_clock2_face_resign(movement_settings_t *settings, void *context); +void world_clock2_face_setup(uint8_t watch_face_index, void **context_ptr); +void world_clock2_face_activate(void *context); +bool world_clock2_face_loop(movement_event_t event, void *context); +void world_clock2_face_resign(void *context); #define world_clock2_face ((const watch_face_t){ \ world_clock2_face_setup, \ diff --git a/movement/watch_faces/clock/wyoscan_face.c b/movement/watch_faces/clock/wyoscan_face.c index 66a5d466..1598193f 100644 --- a/movement/watch_faces/clock/wyoscan_face.c +++ b/movement/watch_faces/clock/wyoscan_face.c @@ -90,8 +90,7 @@ static const int32_t clock_mapping[6][7][2] = { {{2,4}, {2,5}, {1,6}, {0,6}, {0,5}, {1,4}, {1,5}}, }; -void wyoscan_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void wyoscan_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(wyoscan_state_t)); @@ -101,14 +100,13 @@ void wyoscan_face_setup(movement_settings_t *settings, uint8_t watch_face_index, // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void wyoscan_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void wyoscan_face_activate(void *context) { wyoscan_state_t *state = (wyoscan_state_t *)context; movement_request_tick_frequency(32); state->total_frames = 64; } -bool wyoscan_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool wyoscan_face_loop(movement_event_t event, void *context) { wyoscan_state_t *state = (wyoscan_state_t *)context; watch_date_time date_time; @@ -195,14 +193,13 @@ bool wyoscan_face_loop(movement_event_t event, movement_settings_t *settings, vo case EVENT_BACKGROUND_TASK: break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void wyoscan_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void wyoscan_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/clock/wyoscan_face.h b/movement/watch_faces/clock/wyoscan_face.h index d20e7636..2816e4d3 100644 --- a/movement/watch_faces/clock/wyoscan_face.h +++ b/movement/watch_faces/clock/wyoscan_face.h @@ -73,11 +73,11 @@ typedef struct { uint32_t illuminated_segments[MAX_ILLUMINATED_SEGMENTS][2]; } wyoscan_state_t; -void wyoscan_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void wyoscan_face_activate(movement_settings_t *settings, void *context); -bool wyoscan_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void wyoscan_face_resign(movement_settings_t *settings, void *context); -bool wyoscan_face_wants_background_task(movement_settings_t *settings, void *context); +void wyoscan_face_setup(uint8_t watch_face_index, void ** context_ptr); +void wyoscan_face_activate(void *context); +bool wyoscan_face_loop(movement_event_t event, void *context); +void wyoscan_face_resign(void *context); +bool wyoscan_face_wants_background_task(void *context); #define wyoscan_face ((const watch_face_t){ \ wyoscan_face_setup, \ diff --git a/movement/watch_faces/complication/activity_face.c b/movement/watch_faces/complication/activity_face.c index c7399c2d..59699c85 100644 --- a/movement/watch_faces/complication/activity_face.c +++ b/movement/watch_faces/complication/activity_face.c @@ -169,11 +169,10 @@ static void _activity_clear_buffers() { } static void _activity_display_choice(activity_state_t *state); -static void _activity_update_logging_screen(movement_settings_t *settings, activity_state_t *state); +static void _activity_update_logging_screen(activity_state_t *state); static uint8_t _activity_get_next_byte(uint8_t *next_byte); -void activity_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) { - (void)settings; +void activity_face_setup(uint8_t watch_face_index, void **context_ptr) { (void)watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(activity_state_t)); @@ -184,8 +183,7 @@ void activity_face_setup(movement_settings_t *settings, uint8_t watch_face_index // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void activity_face_activate(movement_settings_t *settings, void *context) { - (void)settings; +void activity_face_activate(void *context) { (void)context; // Not using this function. Calling _activity_activate from the event handler. @@ -194,7 +192,7 @@ void activity_face_activate(movement_settings_t *settings, void *context) { } // Called from the ACTIVATE event handler in the loop -static void _activity_activate(movement_settings_t *settings, activity_state_t *state) { +static void _activity_activate(activity_state_t *state) { // If waking from low-energy state and currently logging: update seconds values // Those are not up-to-date because ticks have not been coming if (state->le_state != 0 && state->mode == ACTM_LOGGING) { @@ -204,7 +202,7 @@ static void _activity_activate(movement_settings_t *settings, activity_state_t * uint32_t start_timestamp = watch_utility_date_time_to_unix_time(state->start_time, 0); uint32_t total_seconds = now_timestamp - start_timestamp; state->curr_total_sec = total_seconds; - _activity_update_logging_screen(settings, state); + _activity_update_logging_screen(state); } // Regular activation: start from defaults else { @@ -239,7 +237,7 @@ const uint8_t activity_anim_pixels[][2] = { // {2, 4}, // MID }; -static void _activity_update_logging_screen(movement_settings_t *settings, activity_state_t *state) { +static void _activity_update_logging_screen(activity_state_t *state) { watch_duration_t duration; watch_display_string("AC ", 0); @@ -450,7 +448,7 @@ static void _activity_finish_logging(activity_state_t *state) { watch_display_string("AC dONE ", 0); } -static void _activity_handle_tick(movement_settings_t *settings, activity_state_t *state) { +static void _activity_handle_tick(activity_state_t *state) { // Display stopwatch-like duration while logging, alternating with time if (state->mode == ACTM_LOGGING || state->mode == ACTM_PAUSED) { ++state->counter; @@ -463,7 +461,7 @@ static void _activity_handle_tick(movement_settings_t *settings, activity_state_ } // Still logging: refresh display else { - _activity_update_logging_screen(settings, state); + _activity_update_logging_screen(state); } } // Display countown animation, and exit face when down @@ -536,7 +534,7 @@ static void _activity_handle_tick(movement_settings_t *settings, activity_state_ } } -static void _activity_alarm_long(movement_settings_t *settings, activity_state_t *state) { +static void _activity_alarm_long(activity_state_t *state) { // On choose face: start logging activity if (state->mode == ACTM_CHOOSE) { // If buffer is full: Ignore this long press @@ -549,7 +547,7 @@ static void _activity_alarm_long(movement_settings_t *settings, activity_state_t state->counter = -1; state->mode = ACTM_LOGGING; watch_set_indicator(WATCH_INDICATOR_LAP); - _activity_update_logging_screen(settings, state); + _activity_update_logging_screen(state); } // If logging or paused: end logging else if (state->mode == ACTM_LOGGING || state->mode == ACTM_PAUSED) { @@ -589,7 +587,7 @@ static void _activity_alarm_long(movement_settings_t *settings, activity_state_t } } -static void _activity_alarm_short(movement_settings_t *settings, activity_state_t *state) { +static void _activity_alarm_short(activity_state_t *state) { // In the choose face, short ALARM cycles through activities if (state->mode == ACTM_CHOOSE) { state->type_ix = (state->type_ix + 1) % num_enabled_activities; @@ -599,13 +597,13 @@ static void _activity_alarm_short(movement_settings_t *settings, activity_state_ else if (state->mode == ACTM_LOGGING) { state->mode = ACTM_PAUSED; state->counter = 0; - _activity_update_logging_screen(settings, state); + _activity_update_logging_screen(state); } // If paused: Update paused seconds count and return to logging else if (state->mode == ACTM_PAUSED) { state->mode = ACTM_LOGGING; state->counter = 0; - _activity_update_logging_screen(settings, state); + _activity_update_logging_screen(state); } // If chirping: stoppit else if (state->mode == ACTM_CHIRPING) { @@ -649,15 +647,15 @@ static void _activity_light_short(activity_state_t *state) { // Otherwise, we don't do light. } -bool activity_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool activity_face_loop(movement_event_t event, void *context) { activity_state_t *state = (activity_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: - _activity_activate(settings, state); + _activity_activate(state); break; case EVENT_TICK: - _activity_handle_tick(settings, state); + _activity_handle_tick(state); break; case EVENT_MODE_BUTTON_UP: if (state->mode != ACTM_LOGGING && state->mode != ACTM_PAUSED && state->mode != ACTM_CHIRPING) { @@ -672,12 +670,12 @@ bool activity_face_loop(movement_event_t event, movement_settings_t *settings, v // We also receive ALARM press that woke us up from LE state // Don't want to act on that as if it were a real button press for us if (state->le_state != 2) - _activity_alarm_short(settings, state); + _activity_alarm_short(state); else state->le_state = 0; break; case EVENT_ALARM_LONG_PRESS: - _activity_alarm_long(settings, state); + _activity_alarm_long(state); break; case EVENT_TIMEOUT: if (state->mode != ACTM_LOGGING && state->mode != ACTM_PAUSED && @@ -698,12 +696,12 @@ bool activity_face_loop(movement_event_t event, movement_settings_t *settings, v watch_clear_indicator(WATCH_INDICATOR_PM); } else { - _activity_update_logging_screen(settings, state); + _activity_update_logging_screen(state); watch_start_tick_animation(500); } break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } @@ -714,8 +712,7 @@ bool activity_face_loop(movement_event_t event, movement_settings_t *settings, v return true; } -void activity_face_resign(movement_settings_t *settings, void *context) { - (void)settings; +void activity_face_resign(void *context) { (void)context; // Face should only ever temporarily request a higher frequency, so by the time we're resigning, diff --git a/movement/watch_faces/complication/activity_face.h b/movement/watch_faces/complication/activity_face.h index 552ef4d8..48f9ee88 100644 --- a/movement/watch_faces/complication/activity_face.h +++ b/movement/watch_faces/complication/activity_face.h @@ -71,10 +71,10 @@ #include "movement.h" -void activity_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void activity_face_activate(movement_settings_t *settings, void *context); -bool activity_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void activity_face_resign(movement_settings_t *settings, void *context); +void activity_face_setup(uint8_t watch_face_index, void ** context_ptr); +void activity_face_activate(void *context); +bool activity_face_loop(movement_event_t event, void *context); +void activity_face_resign(void *context); #define activity_face ((const watch_face_t){ \ activity_face_setup, \ diff --git a/movement/watch_faces/complication/alarm_face.c b/movement/watch_faces/complication/alarm_face.c index 54b01c31..b84a6523 100644 --- a/movement/watch_faces/complication/alarm_face.c +++ b/movement/watch_faces/complication/alarm_face.c @@ -63,7 +63,7 @@ static void _alarm_set_signal(alarm_state_t *state) { watch_clear_indicator(WATCH_INDICATOR_SIGNAL); } -static void _alarm_face_draw(movement_settings_t *settings, alarm_state_t *state, uint8_t subsecond) { +static void _alarm_face_draw(alarm_state_t *state, uint8_t subsecond) { char buf[12]; uint8_t i = 0; @@ -119,20 +119,20 @@ static void _alarm_face_draw(movement_settings_t *settings, alarm_state_t *state _alarm_set_signal(state); } -static void _alarm_initiate_setting(movement_settings_t *settings, alarm_state_t *state, uint8_t subsecond) { +static void _alarm_initiate_setting(alarm_state_t *state, uint8_t subsecond) { state->is_setting = true; state->setting_state = 0; movement_request_tick_frequency(4); - _alarm_face_draw(settings, state, subsecond); + _alarm_face_draw(state, subsecond); } -static void _alarm_resume_setting(movement_settings_t *settings, alarm_state_t *state, uint8_t subsecond) { +static void _alarm_resume_setting(alarm_state_t *state, uint8_t subsecond) { state->is_setting = false; movement_request_tick_frequency(1); - _alarm_face_draw(settings, state, subsecond); + _alarm_face_draw(state, subsecond); } -static void _alarm_update_alarm_enabled(movement_settings_t *settings, alarm_state_t *state) { +static void _alarm_update_alarm_enabled(alarm_state_t *state) { // save indication for active alarms to movement settings bool active_alarms = false; watch_date_time now; @@ -199,8 +199,7 @@ static void _abort_quick_ticks(alarm_state_t *state) { } } -void alarm_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) { - (void) settings; +void alarm_face_setup(uint8_t watch_face_index, void **context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -218,24 +217,22 @@ void alarm_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v } } -void alarm_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void alarm_face_activate(void *context) { (void) context; watch_set_colon(); } -void alarm_face_resign(movement_settings_t *settings, void *context) { +void alarm_face_resign(void *context) { alarm_state_t *state = (alarm_state_t *)context; state->is_setting = false; - _alarm_update_alarm_enabled(settings, state); + _alarm_update_alarm_enabled(state); watch_set_led_off(); state->alarm_quick_ticks = false; _wait_ticks = -1; movement_request_tick_frequency(1); } -bool alarm_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool alarm_face_wants_background_task(void *context) { alarm_state_t *state = (alarm_state_t *)context; watch_date_time now = watch_rtc_get_date_time(); // just a failsafe: never fire more than one alarm within a minute @@ -258,12 +255,11 @@ bool alarm_face_wants_background_task(movement_settings_t *settings, void *conte } state->alarm_handled_minute = -1; // update the movement's alarm indicator five times an hour - if (now.unit.minute % 12 == 0) _alarm_update_alarm_enabled(settings, state); + if (now.unit.minute % 12 == 0) _alarm_update_alarm_enabled(state); return false; } -bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool alarm_face_loop(movement_event_t event, void *context) { alarm_state_t *state = (alarm_state_t *)context; switch (event.event_type) { @@ -291,25 +287,25 @@ bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void } // fall through case EVENT_ACTIVATE: - _alarm_face_draw(settings, state, event.subsecond); + _alarm_face_draw(state, event.subsecond); break; case EVENT_LIGHT_BUTTON_UP: if (!state->is_setting) { movement_illuminate_led(); - _alarm_initiate_setting(settings, state, event.subsecond); + _alarm_initiate_setting(state, event.subsecond); break; } state->setting_state += 1; if (state->setting_state >= ALARM_SETTING_STATES) { // we have done a full settings cycle, so resume to normal - _alarm_resume_setting(settings, state, event.subsecond); + _alarm_resume_setting(state, event.subsecond); } break; case EVENT_LIGHT_LONG_PRESS: if (state->is_setting) { - _alarm_resume_setting(settings, state, event.subsecond); + _alarm_resume_setting(state, event.subsecond); } else { - _alarm_initiate_setting(settings, state, event.subsecond); + _alarm_initiate_setting(state, event.subsecond); } break; case EVENT_ALARM_BUTTON_UP: @@ -357,7 +353,7 @@ bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void // auto enable an alarm if user sets anything if (state->setting_state > alarm_setting_idx_alarm) state->alarm[state->alarm_idx].enabled = true; } - _alarm_face_draw(settings, state, event.subsecond); + _alarm_face_draw(state, event.subsecond); break; case EVENT_ALARM_LONG_PRESS: if (!state->is_setting) { @@ -382,7 +378,7 @@ bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void break; } } - _alarm_face_draw(settings, state, event.subsecond); + _alarm_face_draw(state, event.subsecond); break; case EVENT_ALARM_LONG_UP: if (state->is_setting) { @@ -414,7 +410,7 @@ bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void state->alarm[state->alarm_playing_idx].beeps = 5; state->alarm[state->alarm_playing_idx].pitch = 1; state->alarm[state->alarm_playing_idx].enabled = false; - _alarm_update_alarm_enabled(settings, state); + _alarm_update_alarm_enabled(state); } break; case EVENT_TIMEOUT: @@ -424,7 +420,7 @@ bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } diff --git a/movement/watch_faces/complication/alarm_face.h b/movement/watch_faces/complication/alarm_face.h index 1c22948e..f46da395 100644 --- a/movement/watch_faces/complication/alarm_face.h +++ b/movement/watch_faces/complication/alarm_face.h @@ -85,11 +85,11 @@ typedef struct { } alarm_state_t; -void alarm_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void alarm_face_activate(movement_settings_t *settings, void *context); -bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void alarm_face_resign(movement_settings_t *settings, void *context); -bool alarm_face_wants_background_task(movement_settings_t *settings, void *context); +void alarm_face_setup(uint8_t watch_face_index, void ** context_ptr); +void alarm_face_activate(void *context); +bool alarm_face_loop(movement_event_t event, void *context); +void alarm_face_resign(void *context); +bool alarm_face_wants_background_task(void *context); #define alarm_face ((const watch_face_t){ \ alarm_face_setup, \ diff --git a/movement/watch_faces/complication/astronomy_face.c b/movement/watch_faces/complication/astronomy_face.c index dece5247..a02dd06d 100644 --- a/movement/watch_faces/complication/astronomy_face.c +++ b/movement/watch_faces/complication/astronomy_face.c @@ -59,7 +59,7 @@ static const char astronomy_celestial_body_names[NUM_AVAILABLE_BODIES][3] = { "NE" // Neptune }; -static void _astronomy_face_recalculate(movement_settings_t *settings, astronomy_state_t *state) { +static void _astronomy_face_recalculate(astronomy_state_t *state) { #if __EMSCRIPTEN__ int16_t browser_lat = EM_ASM_INT({ return lat; @@ -116,7 +116,7 @@ static void _astronomy_face_recalculate(movement_settings_t *settings, astronomy state->distance); } -static void _astronomy_face_update(movement_event_t event, movement_settings_t *settings, astronomy_state_t *state) { +static void _astronomy_face_update(movement_event_t event, astronomy_state_t *state) { char buf[16]; switch (state->mode) { case ASTRONOMY_MODE_SELECTING_BODY: @@ -150,7 +150,7 @@ static void _astronomy_face_update(movement_event_t event, movement_settings_t * watch_clear_display(); // this takes a moment and locks the UI, flash C for "Calculating" watch_start_character_blink('C', 100); - _astronomy_face_recalculate(settings, state); + _astronomy_face_recalculate(state); watch_stop_blink(); state->mode = ASTRONOMY_MODE_DISPLAYING_ALT; // fall through @@ -188,8 +188,7 @@ static void _astronomy_face_update(movement_event_t event, movement_settings_t * } } -void astronomy_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void astronomy_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(astronomy_state_t)); @@ -197,8 +196,7 @@ void astronomy_face_setup(movement_settings_t *settings, uint8_t watch_face_inde } } -void astronomy_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void astronomy_face_activate(void *context) { astronomy_state_t *state = (astronomy_state_t *)context; movement_location_t movement_location = (movement_location_t) watch_get_backup_data(1); int16_t lat_centi = (int16_t)movement_location.bit.latitude; @@ -211,13 +209,13 @@ void astronomy_face_activate(movement_settings_t *settings, void *context) { movement_request_tick_frequency(4); } -bool astronomy_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool astronomy_face_loop(movement_event_t event, void *context) { astronomy_state_t *state = (astronomy_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: case EVENT_TICK: - _astronomy_face_update(event, settings, state); + _astronomy_face_update(event, state); break; case EVENT_ALARM_BUTTON_UP: switch (state->mode) { @@ -237,19 +235,19 @@ bool astronomy_face_loop(movement_event_t event, movement_settings_t *settings, state->mode++; break; } - _astronomy_face_update(event, settings, state); + _astronomy_face_update(event, state); break; case EVENT_ALARM_LONG_PRESS: if (state->mode == ASTRONOMY_MODE_SELECTING_BODY) { // celestial body selected! this triggers a calculation in the update method. state->mode = ASTRONOMY_MODE_CALCULATING; movement_request_tick_frequency(1); - _astronomy_face_update(event, settings, state); + _astronomy_face_update(event, state); } else if (state->mode != ASTRONOMY_MODE_CALCULATING) { // in all modes except "doing a calculation", return to the selection screen. state->mode = ASTRONOMY_MODE_SELECTING_BODY; movement_request_tick_frequency(4); - _astronomy_face_update(event, settings, state); + _astronomy_face_update(event, state); } break; case EVENT_TIMEOUT: @@ -259,15 +257,14 @@ bool astronomy_face_loop(movement_event_t event, movement_settings_t *settings, // TODO? break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void astronomy_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void astronomy_face_resign(void *context) { astronomy_state_t *state = (astronomy_state_t *)context; state->mode = ASTRONOMY_MODE_SELECTING_BODY; } diff --git a/movement/watch_faces/complication/astronomy_face.h b/movement/watch_faces/complication/astronomy_face.h index 6ab22113..e0b33f5e 100644 --- a/movement/watch_faces/complication/astronomy_face.h +++ b/movement/watch_faces/complication/astronomy_face.h @@ -93,10 +93,10 @@ typedef struct { double distance; // in AU } astronomy_state_t; -void astronomy_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void astronomy_face_activate(movement_settings_t *settings, void *context); -bool astronomy_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void astronomy_face_resign(movement_settings_t *settings, void *context); +void astronomy_face_setup(uint8_t watch_face_index, void ** context_ptr); +void astronomy_face_activate(void *context); +bool astronomy_face_loop(movement_event_t event, void *context); +void astronomy_face_resign(void *context); #define astronomy_face ((const watch_face_t){ \ astronomy_face_setup, \ diff --git a/movement/watch_faces/complication/blinky_face.c b/movement/watch_faces/complication/blinky_face.c index 2deafc68..aa434667 100644 --- a/movement/watch_faces/complication/blinky_face.c +++ b/movement/watch_faces/complication/blinky_face.c @@ -27,8 +27,7 @@ #include "blinky_face.h" #include "watch.h" -void blinky_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void blinky_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(blinky_face_state_t)); @@ -36,8 +35,7 @@ void blinky_face_setup(movement_settings_t *settings, uint8_t watch_face_index, } } -void blinky_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void blinky_face_activate(void *context) { blinky_face_state_t *state = (blinky_face_state_t *)context; state->active = false; } @@ -49,8 +47,7 @@ static void _blinky_face_update_lcd(blinky_face_state_t *state) { watch_display_string(buf, 0); } -bool blinky_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool blinky_face_loop(movement_event_t event, void *context) { blinky_face_state_t *state = (blinky_face_state_t *)context; switch (event.event_type) { @@ -92,15 +89,14 @@ bool blinky_face_loop(movement_event_t event, movement_settings_t *settings, voi if (!state->active) movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void blinky_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void blinky_face_resign(void *context) { (void) context; watch_set_led_off(); } diff --git a/movement/watch_faces/complication/blinky_face.h b/movement/watch_faces/complication/blinky_face.h index f453de64..cf6f2656 100644 --- a/movement/watch_faces/complication/blinky_face.h +++ b/movement/watch_faces/complication/blinky_face.h @@ -59,10 +59,10 @@ typedef struct { uint8_t color; } blinky_face_state_t; -void blinky_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void blinky_face_activate(movement_settings_t *settings, void *context); -bool blinky_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void blinky_face_resign(movement_settings_t *settings, void *context); +void blinky_face_setup(uint8_t watch_face_index, void ** context_ptr); +void blinky_face_activate(void *context); +bool blinky_face_loop(movement_event_t event, void *context); +void blinky_face_resign(void *context); #define blinky_face ((const watch_face_t){ \ blinky_face_setup, \ diff --git a/movement/watch_faces/complication/breathing_face.c b/movement/watch_faces/complication/breathing_face.c index 51753069..c9ea67ab 100644 --- a/movement/watch_faces/complication/breathing_face.c +++ b/movement/watch_faces/complication/breathing_face.c @@ -37,10 +37,9 @@ static void beep_in_hold (void); static void beep_out (void); static void beep_out_hold (void); -void breathing_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void breathing_face_setup(uint8_t watch_face_index, void ** context_ptr) { // These next two lines just silence the compiler warnings associated with unused parameters. // We have no use for the settings or the watch_face_index, so we make that explicit here. - (void) settings; (void) watch_face_index; // At boot, context_ptr will be NULL indicating that we don't have anyplace to store our context. if (*context_ptr == NULL) { @@ -49,9 +48,8 @@ void breathing_face_setup(movement_settings_t *settings, uint8_t watch_face_inde } } -void breathing_face_activate(movement_settings_t *settings, void *context) { +void breathing_face_activate(void *context) { // same as above: silence the warning, we don't need to check the settings. - (void) settings; // we do however need to set some things in our context. Here we cast it to the correct type... breathing_state_t *state = (breathing_state_t *)context; // ...and set the initial state of our watch face. @@ -125,8 +123,7 @@ void beep_out_hold (void) { } } -bool breathing_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool breathing_face_loop(movement_event_t event, void *context) { breathing_state_t *state = (breathing_state_t *)context; switch (event.event_type) { @@ -193,16 +190,15 @@ bool breathing_face_loop(movement_event_t event, movement_settings_t *settings, // movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void breathing_face_resign(movement_settings_t *settings, void *context) { +void breathing_face_resign(void *context) { // our watch face, like most watch faces, has nothing special to do when resigning. // watch faces that enable a peripheral or interact with a sensor may want to turn it off here. - (void) settings; (void) context; } diff --git a/movement/watch_faces/complication/breathing_face.h b/movement/watch_faces/complication/breathing_face.h index fd603f19..91ef2a64 100644 --- a/movement/watch_faces/complication/breathing_face.h +++ b/movement/watch_faces/complication/breathing_face.h @@ -38,10 +38,10 @@ #include "movement.h" -void breathing_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void breathing_face_activate(movement_settings_t *settings, void *context); -bool breathing_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void breathing_face_resign(movement_settings_t *settings, void *context); +void breathing_face_setup(uint8_t watch_face_index, void ** context_ptr); +void breathing_face_activate(void *context); +bool breathing_face_loop(movement_event_t event, void *context); +void breathing_face_resign(void *context); #define breathing_face ((const watch_face_t){ \ breathing_face_setup, \ diff --git a/movement/watch_faces/complication/butterfly_game_face.c b/movement/watch_faces/complication/butterfly_game_face.c index fb13b972..b8f5434b 100644 --- a/movement/watch_faces/complication/butterfly_game_face.c +++ b/movement/watch_faces/complication/butterfly_game_face.c @@ -416,8 +416,7 @@ static bool _splash_screen(movement_event_t event, butterfly_game_state_t *state return true; } -void butterfly_game_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void butterfly_game_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -433,14 +432,13 @@ void butterfly_game_face_setup(movement_settings_t *settings, uint8_t watch_face #endif } -void butterfly_game_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void butterfly_game_face_activate(void *context) { (void) context; movement_request_tick_frequency(TICK_FREQ); } -bool butterfly_game_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool butterfly_game_face_loop(movement_event_t event, void *context) { butterfly_game_state_t *state = (butterfly_game_state_t *)context; switch (event.event_type) { @@ -454,12 +452,11 @@ bool butterfly_game_face_loop(movement_event_t event, movement_settings_t *setti movement_move_to_face(0); return true; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } } -void butterfly_game_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void butterfly_game_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/complication/butterfly_game_face.h b/movement/watch_faces/complication/butterfly_game_face.h index d02636e2..59222479 100644 --- a/movement/watch_faces/complication/butterfly_game_face.h +++ b/movement/watch_faces/complication/butterfly_game_face.h @@ -108,10 +108,10 @@ typedef struct { uint8_t score_p2 : 5; } butterfly_game_state_t; -void butterfly_game_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void butterfly_game_face_activate(movement_settings_t *settings, void *context); -bool butterfly_game_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void butterfly_game_face_resign(movement_settings_t *settings, void *context); +void butterfly_game_face_setup(uint8_t watch_face_index, void ** context_ptr); +void butterfly_game_face_activate(void *context); +bool butterfly_game_face_loop(movement_event_t event, void *context); +void butterfly_game_face_resign(void *context); #define butterfly_game_face ((const watch_face_t){ \ butterfly_game_face_setup, \ diff --git a/movement/watch_faces/complication/couch_to_5k_face.c b/movement/watch_faces/complication/couch_to_5k_face.c index b8bcdef9..10103a76 100644 --- a/movement/watch_faces/complication/couch_to_5k_face.c +++ b/movement/watch_faces/complication/couch_to_5k_face.c @@ -121,9 +121,8 @@ static void _display(couch_to_5k_state_t *state, char *buf){ } -void couch_to_5k_face_setup(movement_settings_t *settings, uint8_t +void couch_to_5k_face_setup(uint8_t watch_face_index, void ** context_ptr) { - (void) settings; (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(couch_to_5k_state_t)); @@ -163,15 +162,14 @@ void couch_to_5k_face_setup(movement_settings_t *settings, uint8_t // watch wakes from deep sleep. } -void couch_to_5k_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void couch_to_5k_face_activate(void *context) { (void) context; // Handle any tasks related to your watch face coming on screen. watch_set_colon(); } -bool couch_to_5k_face_loop(movement_event_t event, movement_settings_t *settings, +bool couch_to_5k_face_loop(movement_event_t event, void *context) { couch_to_5k_state_t *state = (couch_to_5k_state_t *)context; static char buf[11]; @@ -241,7 +239,7 @@ bool couch_to_5k_face_loop(movement_event_t event, movement_settings_t *settings // skips to the secondary watch face, if configured) // You can override any of these behaviors by adding a case for // these events to this switch statement. - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } // return true if the watch can enter standby mode. Generally speaking, you @@ -258,8 +256,7 @@ bool couch_to_5k_face_loop(movement_event_t event, movement_settings_t *settings return true; } -void couch_to_5k_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void couch_to_5k_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/complication/couch_to_5k_face.h b/movement/watch_faces/complication/couch_to_5k_face.h index 3c36ce6f..73d7b8fe 100644 --- a/movement/watch_faces/complication/couch_to_5k_face.h +++ b/movement/watch_faces/complication/couch_to_5k_face.h @@ -70,10 +70,10 @@ typedef struct { uint16_t timer; } couch_to_5k_state_t; -void couch_to_5k_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void couch_to_5k_face_activate(movement_settings_t *settings, void *context); -bool couch_to_5k_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void couch_to_5k_face_resign(movement_settings_t *settings, void *context); +void couch_to_5k_face_setup(uint8_t watch_face_index, void ** context_ptr); +void couch_to_5k_face_activate(void *context); +bool couch_to_5k_face_loop(movement_event_t event, void *context); +void couch_to_5k_face_resign(void *context); #define couch_to_5k_face ((const watch_face_t){ \ couch_to_5k_face_setup, \ diff --git a/movement/watch_faces/complication/counter_face.c b/movement/watch_faces/complication/counter_face.c index 69ca1f73..3542d786 100644 --- a/movement/watch_faces/complication/counter_face.c +++ b/movement/watch_faces/complication/counter_face.c @@ -27,8 +27,7 @@ #include "counter_face.h" #include "watch.h" -void counter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void counter_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(counter_state_t)); @@ -38,16 +37,14 @@ void counter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, } } -void counter_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void counter_face_activate(void *context) { counter_state_t *state = (counter_state_t *)context; if (state->beep_on) { watch_set_indicator(WATCH_INDICATOR_SIGNAL); } } -bool counter_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool counter_face_loop(movement_event_t event, void *context) { counter_state_t *state = (counter_state_t *)context; @@ -83,7 +80,7 @@ bool counter_face_loop(movement_event_t event, movement_settings_t *settings, vo // ignore timeout break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } @@ -143,7 +140,6 @@ void print_counter(counter_state_t *state) { watch_display_string(buf, 0); } -void counter_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void counter_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/counter_face.h b/movement/watch_faces/complication/counter_face.h index 3ac6a9b6..2ec68127 100644 --- a/movement/watch_faces/complication/counter_face.h +++ b/movement/watch_faces/complication/counter_face.h @@ -44,10 +44,10 @@ typedef struct { } counter_state_t; -void counter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void counter_face_activate(movement_settings_t *settings, void *context); -bool counter_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void counter_face_resign(movement_settings_t *settings, void *context); +void counter_face_setup(uint8_t watch_face_index, void ** context_ptr); +void counter_face_activate(void *context); +bool counter_face_loop(movement_event_t event, void *context); +void counter_face_resign(void *context); void print_counter(counter_state_t *state); void beep_counter(counter_state_t *state); diff --git a/movement/watch_faces/complication/databank_face.c b/movement/watch_faces/complication/databank_face.c index 8be54a66..34cc4b48 100644 --- a/movement/watch_faces/complication/databank_face.c +++ b/movement/watch_faces/complication/databank_face.c @@ -46,18 +46,16 @@ struct { bool animating; } databank_state; -void databank_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void databank_face_setup(uint8_t watch_face_index, void ** context_ptr) { // These next two lines just silence the compiler warnings associated with unused parameters. // We have no use for the settings or the watch_face_index, so we make that explicit here. - (void) settings; (void) context_ptr; (void) watch_face_index; // At boot, context_ptr will be NULL indicating that we don't have anyplace to store our context. } -void databank_face_activate(movement_settings_t *settings, void *context) { +void databank_face_activate(void *context) { // same as above: silence the warning, we don't need to check the settings. - (void) settings; (void) context; // we do however need to set some things in our context. Here we cast it to the correct type... databank_state.current_word = 0; @@ -85,8 +83,7 @@ static void display() } } -bool databank_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool databank_face_loop(movement_event_t event, void *context) { (void) context; int max_words = (strlen(pi_data[databank_state.databank_page * 2 + 1]) - 1) / 6 + 1; @@ -132,16 +129,15 @@ bool databank_face_loop(movement_event_t event, movement_settings_t *settings, v // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void databank_face_resign(movement_settings_t *settings, void *context) { +void databank_face_resign(void *context) { // our watch face, like most watch faces, has nothing special to do when resigning. // watch faces that enable a peripheral or interact with a sensor may want to turn it off here. - (void) settings; (void) context; } diff --git a/movement/watch_faces/complication/databank_face.h b/movement/watch_faces/complication/databank_face.h index 3376cefa..a9a4a32d 100644 --- a/movement/watch_faces/complication/databank_face.h +++ b/movement/watch_faces/complication/databank_face.h @@ -44,10 +44,10 @@ #include "movement.h" -void databank_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void databank_face_activate(movement_settings_t *settings, void *context); -bool databank_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void databank_face_resign(movement_settings_t *settings, void *context); +void databank_face_setup(uint8_t watch_face_index, void ** context_ptr); +void databank_face_activate(void *context); +bool databank_face_loop(movement_event_t event, void *context); +void databank_face_resign(void *context); #define databank_face ((const watch_face_t){ \ databank_face_setup, \ diff --git a/movement/watch_faces/complication/day_one_face.c b/movement/watch_faces/complication/day_one_face.c index aa65321e..46b2c4fc 100644 --- a/movement/watch_faces/complication/day_one_face.c +++ b/movement/watch_faces/complication/day_one_face.c @@ -73,8 +73,7 @@ static void _day_one_face_increment(day_one_state_t *state) { state->birth_day = 1; } -void day_one_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void day_one_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(day_one_state_t)); @@ -92,8 +91,7 @@ void day_one_face_setup(movement_settings_t *settings, uint8_t watch_face_index, } } -void day_one_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void day_one_face_activate(void *context) { day_one_state_t *state = (day_one_state_t *)context; state->current_page = PAGE_DISPLAY; @@ -107,8 +105,7 @@ void day_one_face_activate(movement_settings_t *settings, void *context) { state->birth_day = movement_birthdate.bit.day; } -bool day_one_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool day_one_face_loop(movement_event_t event, void *context) { day_one_state_t *state = (day_one_state_t *)context; char buf[9]; @@ -252,15 +249,14 @@ bool day_one_face_loop(movement_event_t event, movement_settings_t *settings, vo } break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void day_one_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void day_one_face_resign(void *context) { day_one_state_t *state = (day_one_state_t *)context; // if the user changed their birth date, store it to the birth date register diff --git a/movement/watch_faces/complication/day_one_face.h b/movement/watch_faces/complication/day_one_face.h index 9a59e3bb..ab6a3ce3 100644 --- a/movement/watch_faces/complication/day_one_face.h +++ b/movement/watch_faces/complication/day_one_face.h @@ -67,10 +67,10 @@ typedef struct { uint8_t ticks; } day_one_state_t; -void day_one_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void day_one_face_activate(movement_settings_t *settings, void *context); -bool day_one_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void day_one_face_resign(movement_settings_t *settings, void *context); +void day_one_face_setup(uint8_t watch_face_index, void ** context_ptr); +void day_one_face_activate(void *context); +bool day_one_face_loop(movement_event_t event, void *context); +void day_one_face_resign(void *context); #define day_one_face ((const watch_face_t){ \ day_one_face_setup, \ diff --git a/movement/watch_faces/complication/deadline_face.c b/movement/watch_faces/complication/deadline_face.c index 6af7be3a..6243fc07 100644 --- a/movement/watch_faces/complication/deadline_face.c +++ b/movement/watch_faces/complication/deadline_face.c @@ -107,27 +107,26 @@ const char settings_titles[SETTINGS_NUM][3] = { "YR", "MO", "DA", "HR", "M1" }; /* Local functions */ -static void _running_init(movement_settings_t *settings, deadline_state_t *state); -static bool _running_loop(movement_event_t event, movement_settings_t *settings, void *context); -static void _running_display(movement_event_t event, movement_settings_t *settings, deadline_state_t *state); -static void _setting_init(movement_settings_t *settings, deadline_state_t *state); -static bool _setting_loop(movement_event_t event, movement_settings_t *settings, void *context); -static void _setting_display(movement_event_t event, movement_settings_t *settings, deadline_state_t *state, watch_date_time date); +static void _running_init(deadline_state_t *state); +static bool _running_loop(movement_event_t event, void *context); +static void _running_display(movement_event_t event, deadline_state_t *state); +static void _setting_init(deadline_state_t *state); +static bool _setting_loop(movement_event_t event, void *context); +static void _setting_display(movement_event_t event, deadline_state_t *state, watch_date_time date); /* Utility functions */ -static void _background_alarm_play(movement_settings_t *settings, deadline_state_t *state); -static void _background_alarm_schedule(movement_settings_t *settings, deadline_state_t *state); -static void _background_alarm_cancel(movement_settings_t *settings, deadline_state_t *state); -static void _increment_date(movement_settings_t *settings, deadline_state_t *state, watch_date_time date_time); -static inline int32_t _get_tz_offset(movement_settings_t *settings); +static void _background_alarm_play(deadline_state_t *state); +static void _background_alarm_schedule(deadline_state_t *state); +static void _background_alarm_cancel(deadline_state_t *state); +static void _increment_date(deadline_state_t *state, watch_date_time date_time); static inline void _change_tick_freq(uint8_t freq, deadline_state_t *state); static inline bool _is_leap(int16_t y); static inline int _days_in_month(int16_t mpnth, int16_t y); static inline unsigned int _mod(int a, int b); -static inline void _beep_button(movement_settings_t *settings); -static inline void _beep_enable(movement_settings_t *settings); -static inline void _beep_disable(movement_settings_t *settings); -static inline void _reset_deadline(movement_settings_t *settings, deadline_state_t *state); +static inline void _beep_button(); +static inline void _beep_enable(); +static inline void _beep_disable(); +static inline void _reset_deadline(deadline_state_t *state); /* Check for leap year */ static inline bool _is_leap(int16_t y) @@ -156,14 +155,8 @@ static inline int _days_in_month(int16_t month, int16_t year) } } -/* Return time zone offset */ -static inline int32_t _get_tz_offset(movement_settings_t *settings) -{ - return movement_get_current_timezone_offset(); -} - /* Beep for a button press*/ -static inline void _beep_button(movement_settings_t *settings) +static inline void _beep_button() { // Play a beep as confirmation for a button press (if applicable) if (!movement_button_should_sound()) @@ -173,7 +166,7 @@ static inline void _beep_button(movement_settings_t *settings) } /* Beep for entering settings */ -static inline void _beep_enable(movement_settings_t *settings) +static inline void _beep_enable() { if (!movement_button_should_sound()) return; @@ -184,7 +177,7 @@ static inline void _beep_enable(movement_settings_t *settings) } /* Beep for leaving settings */ -static inline void _beep_disable(movement_settings_t *settings) +static inline void _beep_disable() { if (!movement_button_should_sound()) return; @@ -204,10 +197,10 @@ static inline void _change_tick_freq(uint8_t freq, deadline_state_t *state) } /* Determine index of closest deadline */ -static uint8_t _closest_deadline(movement_settings_t *settings, deadline_state_t *state) +static uint8_t _closest_deadline(deadline_state_t *state) { watch_date_time now = watch_rtc_get_date_time(); - uint32_t now_ts = watch_utility_date_time_to_unix_time(now, _get_tz_offset(settings)); + uint32_t now_ts = watch_utility_date_time_to_unix_time(now, movement_get_current_timezone_offset()); uint32_t min_ts = UINT32_MAX; uint8_t min_index = 0; @@ -222,9 +215,8 @@ static uint8_t _closest_deadline(movement_settings_t *settings, deadline_state_t } /* Play background alarm */ -static void _background_alarm_play(movement_settings_t *settings, deadline_state_t *state) +static void _background_alarm_play(deadline_state_t *state) { - (void) settings; /* Use the default alarm from movement and move to foreground */ if (state->alarm_enabled) { @@ -234,22 +226,21 @@ static void _background_alarm_play(movement_settings_t *settings, deadline_state } /* Schedule background alarm */ -static void _background_alarm_schedule(movement_settings_t *settings, deadline_state_t *state) +static void _background_alarm_schedule(deadline_state_t *state) { /* We simply re-use the scheduling in the background task */ - deadline_face_wants_background_task(settings, state); + deadline_face_wants_background_task(state); } /* Cancel background alarm */ -static void _background_alarm_cancel(movement_settings_t *settings, deadline_state_t *state) +static void _background_alarm_cancel(deadline_state_t *state) { - (void) settings; movement_cancel_background_task_for_face(state->face_idx); } /* Reset deadline to tomorrow */ -static inline void _reset_deadline(movement_settings_t *settings, deadline_state_t *state) +static inline void _reset_deadline(deadline_state_t *state) { /* Get current time and reset hours/minutes/seconds */ watch_date_time date_time = watch_rtc_get_date_time(); @@ -258,14 +249,14 @@ static inline void _reset_deadline(movement_settings_t *settings, deadline_state date_time.unit.hour = 0; /* Add 24 hours to obtain first second of tomorrow */ - uint32_t ts = watch_utility_date_time_to_unix_time(date_time, _get_tz_offset(settings)); + uint32_t ts = watch_utility_date_time_to_unix_time(date_time, movement_get_current_timezone_offset()); ts += 24 * 60 * 60; state->deadlines[state->current_index] = ts; } /* Increment date in settings mode. Function taken from `set_time_face.c` */ -static void _increment_date(movement_settings_t *settings, deadline_state_t *state, watch_date_time date_time) +static void _increment_date(deadline_state_t *state, watch_date_time date_time) { const uint8_t days_in_month[12] = { 31, 28, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31 }; @@ -296,15 +287,14 @@ static void _increment_date(movement_settings_t *settings, deadline_state_t *sta break; } - uint32_t ts = watch_utility_date_time_to_unix_time(date_time, _get_tz_offset(settings)); + uint32_t ts = watch_utility_date_time_to_unix_time(date_time, movement_get_current_timezone_offset()); state->deadlines[state->current_index] = ts; } /* Update display in running mode */ -static void _running_display(movement_event_t event, movement_settings_t *settings, deadline_state_t *state) +static void _running_display(movement_event_t event, deadline_state_t *state) { (void) event; - (void) settings; /* Seconds, minutes, hours, days, months, years */ int16_t unit[] = { 0, 0, 0, 0, 0, 0 }; @@ -318,7 +308,7 @@ static void _running_display(movement_event_t event, movement_settings_t *settin watch_clear_indicator(WATCH_INDICATOR_BELL); watch_date_time now = watch_rtc_get_date_time(); - uint32_t now_ts = watch_utility_date_time_to_unix_time(now, _get_tz_offset(settings)); + uint32_t now_ts = watch_utility_date_time_to_unix_time(now, movement_get_current_timezone_offset()); /* Deadline expired */ if (state->deadlines[state->current_index] < now_ts) { @@ -333,7 +323,7 @@ static void _running_display(movement_event_t event, movement_settings_t *settin } /* Get date time structs */ - watch_date_time deadline = watch_utility_date_time_from_unix_time(state->deadlines[state->current_index], _get_tz_offset(settings) + watch_date_time deadline = watch_utility_date_time_from_unix_time(state->deadlines[state->current_index], movement_get_current_timezone_offset() ); /* Calculate naive difference of dates */ @@ -378,9 +368,8 @@ static void _running_display(movement_event_t event, movement_settings_t *settin } /* Init running mode */ -static void _running_init(movement_settings_t *settings, deadline_state_t *state) +static void _running_init(deadline_state_t *state) { - (void) settings; (void) state; watch_clear_indicator(WATCH_INDICATOR_24H); @@ -392,22 +381,22 @@ static void _running_init(movement_settings_t *settings, deadline_state_t *state } /* Loop of running mode */ -static bool _running_loop(movement_event_t event, movement_settings_t *settings, void *context) +static bool _running_loop(movement_event_t event, void *context) { deadline_state_t *state = (deadline_state_t *) context; if (event.event_type != EVENT_BACKGROUND_TASK) - _running_display(event, settings, state); + _running_display(event, state); switch (event.event_type) { case EVENT_ALARM_BUTTON_UP: - _beep_button(settings); + _beep_button(); state->current_index = (state->current_index + 1) % DEADLINE_FACE_DATES; - _running_display(event, settings, state); + _running_display(event, state); break; case EVENT_ALARM_LONG_PRESS: - _beep_enable(settings); - _setting_init(settings, state); + _beep_enable(); + _setting_init(state); state->mode = DEADLINE_FACE_SETTING; break; case EVENT_MODE_BUTTON_UP: @@ -416,32 +405,32 @@ static bool _running_loop(movement_event_t event, movement_settings_t *settings, case EVENT_LIGHT_BUTTON_DOWN: break; case EVENT_LIGHT_LONG_PRESS: - _beep_button(settings); + _beep_button(); state->alarm_enabled = !state->alarm_enabled; if (state->alarm_enabled) { _background_alarm_schedule(settings, context); } else { _background_alarm_cancel(settings, context); } - _running_display(event, settings, state); + _running_display(event, state); break; case EVENT_TIMEOUT: movement_move_to_face(0); break; case EVENT_BACKGROUND_TASK: - _background_alarm_play(settings, state); + _background_alarm_play(state); break; case EVENT_LOW_ENERGY_UPDATE: break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } /* Update display in settings mode */ -static void _setting_display(movement_event_t event, movement_settings_t *settings, deadline_state_t *state, watch_date_time date_time) +static void _setting_display(movement_event_t event, deadline_state_t *state, watch_date_time date_time) { char buf[11]; @@ -487,13 +476,13 @@ static void _setting_display(movement_event_t event, movement_settings_t *settin } /* Init setting mode */ -static void _setting_init(movement_settings_t *settings, deadline_state_t *state) +static void _setting_init(deadline_state_t *state) { state->current_page = 0; /* Init fresh deadline to next day */ if (state->deadlines[state->current_index] == 0) { - _reset_deadline(settings, state); + _reset_deadline(state); } /* Ensure 1Hz updates only */ @@ -501,21 +490,21 @@ static void _setting_init(movement_settings_t *settings, deadline_state_t *state } /* Loop of setting mode */ -static bool _setting_loop(movement_event_t event, movement_settings_t *settings, void *context) +static bool _setting_loop(movement_event_t event, void *context) { deadline_state_t *state = (deadline_state_t *) context; watch_date_time date_time; - date_time = watch_utility_date_time_from_unix_time(state->deadlines[state->current_index], _get_tz_offset(settings)); + date_time = watch_utility_date_time_from_unix_time(state->deadlines[state->current_index], movement_get_current_timezone_offset()); if (event.event_type != EVENT_BACKGROUND_TASK) - _setting_display(event, settings, state, date_time); + _setting_display(event, state, date_time); switch (event.event_type) { case EVENT_TICK: if (state->tick_freq == 8) { if (watch_get_pin_level(BTN_ALARM)) { - _increment_date(settings, state, date_time); - _setting_display(event, settings, state, date_time); + _increment_date(state, date_time); + _setting_display(event, state, date_time); } else { _change_tick_freq(4, state); } @@ -528,48 +517,47 @@ static bool _setting_loop(movement_event_t event, movement_settings_t *settings, _change_tick_freq(4, state); break; case EVENT_LIGHT_LONG_PRESS: - _beep_button(settings); - _reset_deadline(settings, state); + _beep_button(); + _reset_deadline(state); break; case EVENT_LIGHT_BUTTON_DOWN: break; case EVENT_LIGHT_BUTTON_UP: state->current_page = (state->current_page + 1) % SETTINGS_NUM; - _setting_display(event, settings, state, date_time); + _setting_display(event, state, date_time); break; case EVENT_ALARM_BUTTON_UP: _change_tick_freq(4, state); - _increment_date(settings, state, date_time); - _setting_display(event, settings, state, date_time); + _increment_date(state, date_time); + _setting_display(event, state, date_time); break; case EVENT_TIMEOUT: - _beep_button(settings); + _beep_button(); _background_alarm_schedule(settings, context); _change_tick_freq(1, state); state->mode = DEADLINE_FACE_RUNNING; movement_move_to_face(0); break; case EVENT_MODE_BUTTON_UP: - _beep_disable(settings); + _beep_disable(); _background_alarm_schedule(settings, context); - _running_init(settings, state); - _running_display(event, settings, state); + _running_init(state); + _running_display(event, state); state->mode = DEADLINE_FACE_RUNNING; break; case EVENT_BACKGROUND_TASK: - _background_alarm_play(settings, state); + _background_alarm_play(state); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } /* Setup face */ -void deadline_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) +void deadline_face_setup(uint8_t watch_face_index, void **context_ptr) { - (void) settings; (void) watch_face_index; if (*context_ptr != NULL) return; /* Skip setup if context available */ @@ -584,21 +572,19 @@ void deadline_face_setup(movement_settings_t *settings, uint8_t watch_face_index } /* Activate face */ -void deadline_face_activate(movement_settings_t *settings, void *context) +void deadline_face_activate(void *context) { - (void) settings; deadline_state_t *state = (deadline_state_t *) context; /* Set display options */ - _running_init(settings, state); + _running_init(state); state->mode = DEADLINE_FACE_RUNNING; - state->current_index = _closest_deadline(settings, state); + state->current_index = _closest_deadline(state); } /* Loop face */ -bool deadline_face_loop(movement_event_t event, movement_settings_t *settings, void *context) +bool deadline_face_loop(movement_event_t event, void *context) { - (void) settings; deadline_state_t *state = (deadline_state_t *) context; switch (state->mode) { case DEADLINE_FACE_SETTING: @@ -614,14 +600,13 @@ bool deadline_face_loop(movement_event_t event, movement_settings_t *settings, v } /* Resign face */ -void deadline_face_resign(movement_settings_t *settings, void *context) +void deadline_face_resign(void *context) { - (void) settings; (void) context; } /* Want background task */ -bool deadline_face_wants_background_task(movement_settings_t *settings, void *context) +bool deadline_face_wants_background_task(void *context) { deadline_state_t *state = (deadline_state_t *) context; @@ -630,8 +615,8 @@ bool deadline_face_wants_background_task(movement_settings_t *settings, void *co /* Determine closest deadline */ watch_date_time now = watch_rtc_get_date_time(); - uint32_t now_ts = watch_utility_date_time_to_unix_time(now, _get_tz_offset(settings)); - uint32_t next_ts = state->deadlines[_closest_deadline(settings, state)]; + uint32_t now_ts = watch_utility_date_time_to_unix_time(now, movement_get_current_timezone_offset()); + uint32_t next_ts = state->deadlines[_closest_deadline(state)]; /* No active deadline */ if (next_ts < now_ts) @@ -642,7 +627,7 @@ bool deadline_face_wants_background_task(movement_settings_t *settings, void *co return false; /* Deadline within next minute. Let's set up an alarm */ - watch_date_time next = watch_utility_date_time_from_unix_time(next_ts, _get_tz_offset(settings)); + watch_date_time next = watch_utility_date_time_from_unix_time(next_ts, movement_get_current_timezone_offset()); movement_request_wake(); movement_schedule_background_task_for_face(state->face_idx, next); return false; diff --git a/movement/watch_faces/complication/deadline_face.h b/movement/watch_faces/complication/deadline_face.h index 4e4efe01..f89f3ef2 100644 --- a/movement/watch_faces/complication/deadline_face.h +++ b/movement/watch_faces/complication/deadline_face.h @@ -48,11 +48,11 @@ typedef struct { uint32_t deadlines[DEADLINE_FACE_DATES]; } deadline_state_t; -void deadline_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr); -void deadline_face_activate(movement_settings_t *settings, void *context); -bool deadline_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void deadline_face_resign(movement_settings_t *settings, void *context); -bool deadline_face_wants_background_task(movement_settings_t *settings, void *context); +void deadline_face_setup(uint8_t watch_face_index, void **context_ptr); +void deadline_face_activate(void *context); +bool deadline_face_loop(movement_event_t event, void *context); +void deadline_face_resign(void *context); +bool deadline_face_wants_background_task(void *context); #define deadline_face ((const watch_face_t){ \ deadline_face_setup, \ diff --git a/movement/watch_faces/complication/discgolf_face.c b/movement/watch_faces/complication/discgolf_face.c index 61508c00..8d499920 100644 --- a/movement/watch_faces/complication/discgolf_face.c +++ b/movement/watch_faces/complication/discgolf_face.c @@ -87,7 +87,7 @@ static const char labels[][2] = { /////////////////////////////////////////////////////////////////////////////////////////////// /* Beep function */ -static inline void beep(movement_settings_t *settings) { +static inline void beep() { if (movement_button_should_sound()) watch_buzzer_play_note(BUZZER_NOTE_C7, 50); } @@ -146,8 +146,7 @@ static inline void store_best(discgolf_state_t *state) { } /* Configuration at boot, the high score array can be initialized with your high scores if they're known */ -void discgolf_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void discgolf_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -162,8 +161,7 @@ void discgolf_face_setup(movement_settings_t *settings, uint8_t watch_face_index } } -void discgolf_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void discgolf_face_activate(void *context) { watch_clear_colon(); discgolf_state_t *state = (discgolf_state_t *)context; @@ -178,8 +176,7 @@ void discgolf_face_activate(movement_settings_t *settings, void *context) { movement_request_tick_frequency(4); } -bool discgolf_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool discgolf_face_loop(movement_event_t event, void *context) { discgolf_state_t *state = (discgolf_state_t *)context; @@ -238,7 +235,7 @@ bool discgolf_face_loop(movement_event_t event, movement_settings_t *settings, v state->mode = dg_idle; break; } - beep(settings); + beep(); break; case EVENT_ALARM_BUTTON_UP: switch (state->mode) { @@ -264,14 +261,14 @@ bool discgolf_face_loop(movement_event_t event, movement_settings_t *settings, v state->mode = dg_setting; store_best(state); reset(state); - beep(settings); + beep(); } break; case EVENT_ALARM_LONG_PRESS: /* Snap back to currently playing hole if we've established one*/ if ( (state->mode == dg_idle) && (state->hole != state->playing) && (state->playing <= holes[state->course]) ) { state->hole = state->playing; - beep(settings); + beep(); } break; default: @@ -319,8 +316,7 @@ bool discgolf_face_loop(movement_event_t event, movement_settings_t *settings, v return true; } -void discgolf_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void discgolf_face_resign(void *context) { (void) context; watch_clear_indicator(WATCH_INDICATOR_LAP); } diff --git a/movement/watch_faces/complication/discgolf_face.h b/movement/watch_faces/complication/discgolf_face.h index d168958c..bfdd532b 100644 --- a/movement/watch_faces/complication/discgolf_face.h +++ b/movement/watch_faces/complication/discgolf_face.h @@ -78,10 +78,10 @@ typedef struct { discgolf_mode_t mode; // Watch face mode } discgolf_state_t; -void discgolf_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void discgolf_face_activate(movement_settings_t *settings, void *context); -bool discgolf_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void discgolf_face_resign(movement_settings_t *settings, void *context); +void discgolf_face_setup(uint8_t watch_face_index, void ** context_ptr); +void discgolf_face_activate(void *context); +bool discgolf_face_loop(movement_event_t event, void *context); +void discgolf_face_resign(void *context); #define discgolf_face ((const watch_face_t){ \ discgolf_face_setup, \ diff --git a/movement/watch_faces/complication/dual_timer_face.c b/movement/watch_faces/complication/dual_timer_face.c index f98c35b4..aa91c701 100644 --- a/movement/watch_faces/complication/dual_timer_face.c +++ b/movement/watch_faces/complication/dual_timer_face.c @@ -226,8 +226,7 @@ static void dual_timer_display(dual_timer_state_t *state) { // PUBLIC WATCH FACE FUNCTIONS //////////////////////////////////////////////// -void dual_timer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void dual_timer_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(dual_timer_state_t)); @@ -239,15 +238,14 @@ void dual_timer_face_setup(movement_settings_t *settings, uint8_t watch_face_ind } } -void dual_timer_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void dual_timer_face_activate(void *context) { (void) context; if (_is_running) { movement_schedule_background_task(distant_future); } } -bool dual_timer_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool dual_timer_face_loop(movement_event_t event, void *context) { dual_timer_state_t *state = (dual_timer_state_t *)context; // timers stop at 99:23:59:59:99 @@ -319,14 +317,13 @@ bool dual_timer_face_loop(movement_event_t event, movement_settings_t *settings, dual_timer_display(state); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void dual_timer_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void dual_timer_face_resign(void *context) { (void) context; movement_cancel_background_task(); // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/complication/dual_timer_face.h b/movement/watch_faces/complication/dual_timer_face.h index d1ac7935..e1bd2d5a 100644 --- a/movement/watch_faces/complication/dual_timer_face.h +++ b/movement/watch_faces/complication/dual_timer_face.h @@ -85,10 +85,10 @@ typedef struct { bool show; } dual_timer_state_t; -void dual_timer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void dual_timer_face_activate(movement_settings_t *settings, void *context); -bool dual_timer_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void dual_timer_face_resign(movement_settings_t *settings, void *context); +void dual_timer_face_setup(uint8_t watch_face_index, void ** context_ptr); +void dual_timer_face_activate(void *context); +bool dual_timer_face_loop(movement_event_t event, void *context); +void dual_timer_face_resign(void *context); #if __EMSCRIPTEN__ void em_dual_timer_cb_handler(void *userData); diff --git a/movement/watch_faces/complication/endless_runner_face.c b/movement/watch_faces/complication/endless_runner_face.c index 6d8b4873..d15517ee 100644 --- a/movement/watch_faces/complication/endless_runner_face.c +++ b/movement/watch_faces/complication/endless_runner_face.c @@ -539,8 +539,7 @@ static void update_game(endless_runner_state_t *state, uint8_t subsecond) { display_fuel(subsecond, state -> difficulty); } -void endless_runner_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void endless_runner_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(endless_runner_state_t)); @@ -550,12 +549,11 @@ void endless_runner_face_setup(movement_settings_t *settings, uint8_t watch_face } } -void endless_runner_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void endless_runner_face_activate(void *context) { (void) context; } -bool endless_runner_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool endless_runner_face_loop(movement_event_t event, void *context) { endless_runner_state_t *state = (endless_runner_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: @@ -605,13 +603,12 @@ bool endless_runner_face_loop(movement_event_t event, movement_settings_t *setti display_time(watch_rtc_get_date_time(), movement_clock_mode_24h()); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void endless_runner_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void endless_runner_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/endless_runner_face.h b/movement/watch_faces/complication/endless_runner_face.h index 8c8fa215..3cfa6814 100644 --- a/movement/watch_faces/complication/endless_runner_face.h +++ b/movement/watch_faces/complication/endless_runner_face.h @@ -45,10 +45,10 @@ typedef struct { /* 24 bits, likely aligned to 32 bits = 4 bytes */ } endless_runner_state_t; -void endless_runner_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void endless_runner_face_activate(movement_settings_t *settings, void *context); -bool endless_runner_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void endless_runner_face_resign(movement_settings_t *settings, void *context); +void endless_runner_face_setup(uint8_t watch_face_index, void ** context_ptr); +void endless_runner_face_activate(void *context); +bool endless_runner_face_loop(movement_event_t event, void *context); +void endless_runner_face_resign(void *context); #define endless_runner_face ((const watch_face_t){ \ endless_runner_face_setup, \ diff --git a/movement/watch_faces/complication/flashlight_face.c b/movement/watch_faces/complication/flashlight_face.c index 4922faaf..0c4facd0 100644 --- a/movement/watch_faces/complication/flashlight_face.c +++ b/movement/watch_faces/complication/flashlight_face.c @@ -26,8 +26,7 @@ #include #include "flashlight_face.h" -void flashlight_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void flashlight_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(flashlight_state_t)); @@ -37,15 +36,14 @@ void flashlight_face_setup(movement_settings_t *settings, uint8_t watch_face_ind // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void flashlight_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void flashlight_face_activate(void *context) { (void) context; watch_enable_digital_output(A2); watch_set_pin_level(A2, false); } -bool flashlight_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool flashlight_face_loop(movement_event_t event, void *context) { (void) context; switch (event.event_type) { @@ -65,14 +63,13 @@ bool flashlight_face_loop(movement_event_t event, movement_settings_t *settings, movement_move_to_face(0); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void flashlight_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void flashlight_face_resign(void *context) { (void) context; watch_set_pin_level(A2, false); diff --git a/movement/watch_faces/complication/flashlight_face.h b/movement/watch_faces/complication/flashlight_face.h index 8c0ef8d5..6fc7f8eb 100644 --- a/movement/watch_faces/complication/flashlight_face.h +++ b/movement/watch_faces/complication/flashlight_face.h @@ -42,10 +42,10 @@ typedef struct { uint8_t unused; } flashlight_state_t; -void flashlight_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void flashlight_face_activate(movement_settings_t *settings, void *context); -bool flashlight_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void flashlight_face_resign(movement_settings_t *settings, void *context); +void flashlight_face_setup(uint8_t watch_face_index, void ** context_ptr); +void flashlight_face_activate(void *context); +bool flashlight_face_loop(movement_event_t event, void *context); +void flashlight_face_resign(void *context); #define flashlight_face ((const watch_face_t){ \ flashlight_face_setup, \ diff --git a/movement/watch_faces/complication/geomancy_face.c b/movement/watch_faces/complication/geomancy_face.c index 5928f50d..d5076018 100644 --- a/movement/watch_faces/complication/geomancy_face.c +++ b/movement/watch_faces/complication/geomancy_face.c @@ -71,21 +71,19 @@ static void _throw_animation(geomancy_state_t *state); // WATCH FACE FUNCTIONS /////////////////////////////////////////////////////// -void geomancy_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void geomancy_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; - (void) settings; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(geomancy_state_t)); memset(*context_ptr, 0, sizeof(geomancy_state_t)); } } -void geomancy_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void geomancy_face_activate(void *context) { (void) context; } -bool geomancy_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool geomancy_face_loop(movement_event_t event, void *context) { geomancy_state_t *state = (geomancy_state_t *)context; switch (event.event_type) { @@ -137,13 +135,12 @@ bool geomancy_face_loop(movement_event_t event, movement_settings_t *settings, v geomancy_face_display(state); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void geomancy_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void geomancy_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/geomancy_face.h b/movement/watch_faces/complication/geomancy_face.h index 4710ae7e..c622bfc2 100644 --- a/movement/watch_faces/complication/geomancy_face.h +++ b/movement/watch_faces/complication/geomancy_face.h @@ -82,10 +82,10 @@ typedef struct { bool animate; } geomancy_state_t; -void geomancy_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void geomancy_face_activate(movement_settings_t *settings, void *context); -bool geomancy_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void geomancy_face_resign(movement_settings_t *settings, void *context); +void geomancy_face_setup(uint8_t watch_face_index, void ** context_ptr); +void geomancy_face_activate(void *context); +bool geomancy_face_loop(movement_event_t event, void *context); +void geomancy_face_resign(void *context); #define geomancy_face ((const watch_face_t){ \ geomancy_face_setup, \ diff --git a/movement/watch_faces/complication/habit_face.c b/movement/watch_faces/complication/habit_face.c index 55e7ffce..693d7a0f 100644 --- a/movement/watch_faces/complication/habit_face.c +++ b/movement/watch_faces/complication/habit_face.c @@ -48,9 +48,8 @@ typedef struct { bool display_total; } habit_state_t; -void habit_face_setup(movement_settings_t *settings, uint8_t watch_face_index, +void habit_face_setup(uint8_t watch_face_index, void **context_ptr) { - (void)settings; (void)watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(habit_state_t)); @@ -101,13 +100,12 @@ static inline void display_state(habit_state_t *state) { } } -void habit_face_activate(movement_settings_t *settings, void *context) { - (void)settings; +void habit_face_activate(void *context) { habit_state_t *state = (habit_state_t *)context; display_state(state); } -bool habit_face_loop(movement_event_t event, movement_settings_t *settings, +bool habit_face_loop(movement_event_t event, void *context) { habit_state_t *state = (habit_state_t *)context; @@ -146,12 +144,11 @@ bool habit_face_loop(movement_event_t event, movement_settings_t *settings, break; } default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void habit_face_resign(movement_settings_t *settings, void *context) { - (void)settings; +void habit_face_resign(void *context) { (void)context; } diff --git a/movement/watch_faces/complication/habit_face.h b/movement/watch_faces/complication/habit_face.h index d4f43cf4..6170ee86 100644 --- a/movement/watch_faces/complication/habit_face.h +++ b/movement/watch_faces/complication/habit_face.h @@ -36,11 +36,11 @@ #include "movement.h" -void habit_face_setup(movement_settings_t *settings, uint8_t watch_face_index, +void habit_face_setup(uint8_t watch_face_index, void **context_ptr); -void habit_face_activate(movement_settings_t *settings, void *context); -bool habit_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void habit_face_resign(movement_settings_t *settings, void *context); +void habit_face_activate(void *context); +bool habit_face_loop(movement_event_t event, void *context); +void habit_face_resign(void *context); #define habit_face ((const watch_face_t){ \ habit_face_setup, \ diff --git a/movement/watch_faces/complication/higher_lower_game_face.c b/movement/watch_faces/complication/higher_lower_game_face.c index f9dbcd09..3491b5bd 100755 --- a/movement/watch_faces/complication/higher_lower_game_face.c +++ b/movement/watch_faces/complication/higher_lower_game_face.c @@ -327,8 +327,7 @@ static void alarm_button_handler(void) { do_game_loop(HL_GUESS_LOWER); } -void higher_lower_game_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) { - (void) settings; +void higher_lower_game_face_setup(uint8_t watch_face_index, void **context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -340,15 +339,14 @@ void higher_lower_game_face_setup(movement_settings_t *settings, uint8_t watch_f // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void higher_lower_game_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void higher_lower_game_face_activate(void *context) { higher_lower_game_face_state_t *state = (higher_lower_game_face_state_t *) context; (void) state; // Handle any tasks related to your watch face coming on screen. game_state = HL_GS_TITLE_SCREEN; } -bool higher_lower_game_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool higher_lower_game_face_loop(movement_event_t event, void *context) { higher_lower_game_face_state_t *state = (higher_lower_game_face_state_t *) context; (void) state; @@ -376,7 +374,7 @@ bool higher_lower_game_face_loop(movement_event_t event, movement_settings_t *se // movement_move_to_face(0); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } // return true if the watch can enter standby mode. Generally speaking, you should always return true. @@ -388,8 +386,7 @@ bool higher_lower_game_face_loop(movement_event_t event, movement_settings_t *se return true; } -void higher_lower_game_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void higher_lower_game_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/complication/higher_lower_game_face.h b/movement/watch_faces/complication/higher_lower_game_face.h index 13da5869..51689b57 100755 --- a/movement/watch_faces/complication/higher_lower_game_face.h +++ b/movement/watch_faces/complication/higher_lower_game_face.h @@ -90,10 +90,10 @@ typedef struct { // Anything you need to keep track of, put it here! } higher_lower_game_face_state_t; -void higher_lower_game_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void higher_lower_game_face_activate(movement_settings_t *settings, void *context); -bool higher_lower_game_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void higher_lower_game_face_resign(movement_settings_t *settings, void *context); +void higher_lower_game_face_setup(uint8_t watch_face_index, void ** context_ptr); +void higher_lower_game_face_activate(void *context); +bool higher_lower_game_face_loop(movement_event_t event, void *context); +void higher_lower_game_face_resign(void *context); #define higher_lower_game_face ((const watch_face_t){ \ higher_lower_game_face_setup, \ diff --git a/movement/watch_faces/complication/interval_face.c b/movement/watch_faces/complication/interval_face.c index fb39c9bb..d32c2dc8 100644 --- a/movement/watch_faces/complication/interval_face.c +++ b/movement/watch_faces/complication/interval_face.c @@ -97,7 +97,7 @@ static uint32_t _get_now_ts() { return watch_utility_date_time_to_unix_time(now, 0); } -static inline void _button_beep(movement_settings_t *settings) { +static inline void _button_beep() { // play a beep as confirmation for a button press (if applicable) if (movement_button_should_sound()) watch_buzzer_play_note(BUZZER_NOTE_C7, 50); } @@ -369,8 +369,7 @@ static void _resume_paused_timer(interval_face_state_t *state) { watch_set_indicator(WATCH_INDICATOR_BELL); } -void interval_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) { - (void) settings; +void interval_face_setup(uint8_t watch_face_index, void **context_ptr) { if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(interval_face_state_t)); @@ -394,8 +393,7 @@ void interval_face_setup(movement_settings_t *settings, uint8_t watch_face_index } } -void interval_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void interval_face_activate(void *context) { interval_face_state_t *state = (interval_face_state_t *)context; _erase_timer_flag = false; state->is_active = true; @@ -407,8 +405,7 @@ void interval_face_activate(movement_settings_t *settings, void *context) { } else watch_set_colon(); } -void interval_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void interval_face_resign(void *context) { interval_face_state_t *state = (interval_face_state_t *)context; if (state->face_state <= interval_state_setting) state->face_state = interval_state_waiting; watch_set_led_off(); @@ -416,7 +413,7 @@ void interval_face_resign(movement_settings_t *settings, void *context) { state->is_active = false; } -bool interval_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool interval_face_loop(movement_event_t event, void *context) { interval_face_state_t *state = (interval_face_state_t *)context; interval_timer_setting_t *timer = &state->timer[state->timer_idx]; @@ -618,7 +615,7 @@ bool interval_face_loop(movement_event_t event, movement_settings_t *settings, v // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; diff --git a/movement/watch_faces/complication/interval_face.h b/movement/watch_faces/complication/interval_face.h index 79975855..def944b5 100644 --- a/movement/watch_faces/complication/interval_face.h +++ b/movement/watch_faces/complication/interval_face.h @@ -111,10 +111,10 @@ typedef struct { interval_timer_setting_t timer[INTERVAL_TIMERS]; } interval_face_state_t; -void interval_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void interval_face_activate(movement_settings_t *settings, void *context); -bool interval_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void interval_face_resign(movement_settings_t *settings, void *context); +void interval_face_setup(uint8_t watch_face_index, void ** context_ptr); +void interval_face_activate(void *context); +bool interval_face_loop(movement_event_t event, void *context); +void interval_face_resign(void *context); #define interval_face ((const watch_face_t) { \ interval_face_setup, \ diff --git a/movement/watch_faces/complication/invaders_face.c b/movement/watch_faces/complication/invaders_face.c index c3b13c68..935926a2 100644 --- a/movement/watch_faces/complication/invaders_face.c +++ b/movement/watch_faces/complication/invaders_face.c @@ -203,8 +203,7 @@ static bool _move_invaders() { return false; } -void invaders_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void invaders_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(invaders_state_t)); @@ -220,14 +219,13 @@ void invaders_face_setup(movement_settings_t *settings, uint8_t watch_face_index #endif } -void invaders_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void invaders_face_activate(void *context) { (void) context; _current_state = invaders_state_activated; _signals.suspend_buttons = false; } -bool invaders_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool invaders_face_loop(movement_event_t event, void *context) { invaders_state_t *state = (invaders_state_t *)context; switch (event.event_type) { @@ -414,7 +412,7 @@ bool invaders_face_loop(movement_event_t event, movement_settings_t *settings, v // * EVENT_MODE_BUTTON_UP moves to the next watch face in the list // * EVENT_MODE_LONG_PRESS returns to the first watch face (or skips to the secondary watch face, if configured) // You can override any of these behaviors by adding a case for these events to this switch statement. - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } // return true if the watch can enter standby mode. Generally speaking, you should always return true. @@ -426,8 +424,7 @@ bool invaders_face_loop(movement_event_t event, movement_settings_t *settings, v return true; } -void invaders_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void invaders_face_resign(void *context) { (void) context; _current_state = invaders_state_game_over; } diff --git a/movement/watch_faces/complication/invaders_face.h b/movement/watch_faces/complication/invaders_face.h index 37e91884..88862864 100644 --- a/movement/watch_faces/complication/invaders_face.h +++ b/movement/watch_faces/complication/invaders_face.h @@ -65,10 +65,10 @@ typedef struct { bool sound_on; } invaders_state_t; -void invaders_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void invaders_face_activate(movement_settings_t *settings, void *context); -bool invaders_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void invaders_face_resign(movement_settings_t *settings, void *context); +void invaders_face_setup(uint8_t watch_face_index, void ** context_ptr); +void invaders_face_activate(void *context); +bool invaders_face_loop(movement_event_t event, void *context); +void invaders_face_resign(void *context); #define invaders_face ((const watch_face_t){ \ invaders_face_setup, \ diff --git a/movement/watch_faces/complication/kitchen_conversions_face.c b/movement/watch_faces/complication/kitchen_conversions_face.c index 9d71165a..5c1d1dd8 100644 --- a/movement/watch_faces/complication/kitchen_conversions_face.c +++ b/movement/watch_faces/complication/kitchen_conversions_face.c @@ -79,7 +79,7 @@ static int8_t calc_success_seq[5] = {BUZZER_NOTE_G6, 10, BUZZER_NOTE_C7, 10, 0}; static int8_t calc_fail_seq[5] = {BUZZER_NOTE_C7, 10, BUZZER_NOTE_G6, 10, 0}; // Resets all state variables to 0 -static void reset_state(kitchen_conversions_state_t *state, movement_settings_t *settings) +static void reset_state(kitchen_conversions_state_t *state) { state->pg = measurement; state->measurement_i = 0; @@ -92,9 +92,8 @@ static void reset_state(kitchen_conversions_state_t *state, movement_settings_t state->light_held = false; } -void kitchen_conversions_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) +void kitchen_conversions_face_setup(uint8_t watch_face_index, void **context_ptr) { - (void)settings; (void)watch_face_index; if (*context_ptr == NULL) { @@ -105,9 +104,8 @@ void kitchen_conversions_face_setup(movement_settings_t *settings, uint8_t watch // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void kitchen_conversions_face_activate(movement_settings_t *settings, void *context) +void kitchen_conversions_face_activate(void *context) { - (void)settings; kitchen_conversions_state_t *state = (kitchen_conversions_state_t *)context; // Handle any tasks related to your watch face coming on screen. @@ -168,7 +166,7 @@ static void display_units(uint8_t measurement_i, uint8_t list_i) watch_display_string(get_unit_list(measurement_i)[list_i].name, 4); } -static void display(kitchen_conversions_state_t *state, movement_settings_t *settings, uint8_t subsec) +static void display(kitchen_conversions_state_t *state, uint8_t subsec) { watch_clear_display(); @@ -290,7 +288,7 @@ static void display(kitchen_conversions_state_t *state, movement_settings_t *set } } -bool kitchen_conversions_face_loop(movement_event_t event, movement_settings_t *settings, void *context) +bool kitchen_conversions_face_loop(movement_event_t event, void *context) { kitchen_conversions_state_t *state = (kitchen_conversions_state_t *)context; @@ -465,15 +463,14 @@ bool kitchen_conversions_face_loop(movement_event_t event, movement_settings_t * break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void kitchen_conversions_face_resign(movement_settings_t *settings, void *context) +void kitchen_conversions_face_resign(void *context) { - (void)settings; (void)context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/complication/kitchen_conversions_face.h b/movement/watch_faces/complication/kitchen_conversions_face.h index e732579e..33c6cf4c 100644 --- a/movement/watch_faces/complication/kitchen_conversions_face.h +++ b/movement/watch_faces/complication/kitchen_conversions_face.h @@ -71,10 +71,10 @@ typedef struct bool light_held; } kitchen_conversions_state_t; -void kitchen_conversions_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr); -void kitchen_conversions_face_activate(movement_settings_t *settings, void *context); -bool kitchen_conversions_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void kitchen_conversions_face_resign(movement_settings_t *settings, void *context); +void kitchen_conversions_face_setup(uint8_t watch_face_index, void **context_ptr); +void kitchen_conversions_face_activate(void *context); +bool kitchen_conversions_face_loop(movement_event_t event, void *context); +void kitchen_conversions_face_resign(void *context); #define kitchen_conversions_face ((const watch_face_t){ \ kitchen_conversions_face_setup, \ diff --git a/movement/watch_faces/complication/menstrual_cycle_face.c b/movement/watch_faces/complication/menstrual_cycle_face.c index 57ca9824..42334050 100644 --- a/movement/watch_faces/complication/menstrual_cycle_face.c +++ b/movement/watch_faces/complication/menstrual_cycle_face.c @@ -85,7 +85,7 @@ const char menstrual_cycle_face_titles[MENSTRUAL_CYCLE_FACE_NUM_PAGES][11] = { }; /* Beep function */ -static inline void beep(movement_settings_t *settings) { +static inline void beep() { if (movement_button_should_sound()) watch_buzzer_play_note(BUZZER_NOTE_E8, 75); } @@ -250,9 +250,8 @@ static inline void update_shortest_longest_cycle(menstrual_cycle_state_t *state) state->cycles.bit.longest_cycle = cycle_length; } -void menstrual_cycle_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void menstrual_cycle_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; - (void) settings; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(menstrual_cycle_state_t)); @@ -295,8 +294,7 @@ void menstrual_cycle_face_setup(movement_settings_t *settings, uint8_t watch_fac } } -void menstrual_cycle_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void menstrual_cycle_face_activate(void *context) { menstrual_cycle_state_t *state = (menstrual_cycle_state_t *)context; state->period_today = 0; state->current_page = 0; @@ -305,7 +303,7 @@ void menstrual_cycle_face_activate(movement_settings_t *settings, void *context) movement_request_tick_frequency(4); // we need to manually blink some pixels } -bool menstrual_cycle_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool menstrual_cycle_face_loop(movement_event_t event, void *context) { menstrual_cycle_state_t *state = (menstrual_cycle_state_t *)context; watch_date_time date_period; uint8_t current_page = state->current_page; @@ -406,7 +404,7 @@ bool menstrual_cycle_face_loop(movement_event_t event, movement_settings_t *sett movement_move_to_face(0); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } watch_display_string((char *)menstrual_cycle_face_titles[current_page], 0); @@ -466,7 +464,6 @@ bool menstrual_cycle_face_loop(movement_event_t event, movement_settings_t *sett return true; } -void menstrual_cycle_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void menstrual_cycle_face_resign(void *context) { (void) context; } \ No newline at end of file diff --git a/movement/watch_faces/complication/menstrual_cycle_face.h b/movement/watch_faces/complication/menstrual_cycle_face.h index 73adaf80..5f0dedcf 100644 --- a/movement/watch_faces/complication/menstrual_cycle_face.h +++ b/movement/watch_faces/complication/menstrual_cycle_face.h @@ -64,10 +64,10 @@ typedef struct { bool reset_tracking; } menstrual_cycle_state_t; -void menstrual_cycle_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void menstrual_cycle_face_activate(movement_settings_t *settings, void *context); -bool menstrual_cycle_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void menstrual_cycle_face_resign(movement_settings_t *settings, void *context); +void menstrual_cycle_face_setup(uint8_t watch_face_index, void ** context_ptr); +void menstrual_cycle_face_activate(void *context); +bool menstrual_cycle_face_loop(movement_event_t event, void *context); +void menstrual_cycle_face_resign(void *context); #define menstrual_cycle_face ((const watch_face_t){ \ menstrual_cycle_face_setup, \ diff --git a/movement/watch_faces/complication/metronome_face.c b/movement/watch_faces/complication/metronome_face.c index ad53c6c8..e599362f 100644 --- a/movement/watch_faces/complication/metronome_face.c +++ b/movement/watch_faces/complication/metronome_face.c @@ -30,8 +30,7 @@ static const int8_t _sound_seq_start[] = {BUZZER_NOTE_C8, 2, 0}; static const int8_t _sound_seq_beat[] = {BUZZER_NOTE_C6, 2, 0}; -void metronome_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void metronome_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(metronome_state_t)); @@ -39,8 +38,7 @@ void metronome_face_setup(movement_settings_t *settings, uint8_t watch_face_inde } } -void metronome_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void metronome_face_activate(void *context) { metronome_state_t *state = (metronome_state_t *)context; movement_request_tick_frequency(2); if (state->bpm == 0) { @@ -200,7 +198,7 @@ static void _metronome_update_setting(metronome_state_t *state) { watch_display_string(buf, 0); } -bool metronome_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool metronome_face_loop(movement_event_t event, void *context) { metronome_state_t *state = (metronome_state_t *)context; switch (event.event_type) { @@ -251,13 +249,12 @@ bool metronome_face_loop(movement_event_t event, movement_settings_t *settings, case EVENT_LOW_ENERGY_UPDATE: break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void metronome_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void metronome_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/metronome_face.h b/movement/watch_faces/complication/metronome_face.h index 7c8573f2..32766da6 100644 --- a/movement/watch_faces/complication/metronome_face.h +++ b/movement/watch_faces/complication/metronome_face.h @@ -69,10 +69,10 @@ typedef struct { bool soundOn; } metronome_state_t; -void metronome_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void metronome_face_activate(movement_settings_t *settings, void *context); -bool metronome_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void metronome_face_resign(movement_settings_t *settings, void *context); +void metronome_face_setup(uint8_t watch_face_index, void ** context_ptr); +void metronome_face_activate(void *context); +bool metronome_face_loop(movement_event_t event, void *context); +void metronome_face_resign(void *context); #define metronome_face ((const watch_face_t){ \ metronome_face_setup, \ diff --git a/movement/watch_faces/complication/moon_phase_face.c b/movement/watch_faces/complication/moon_phase_face.c index 6f60c017..5f99a30c 100644 --- a/movement/watch_faces/complication/moon_phase_face.c +++ b/movement/watch_faces/complication/moon_phase_face.c @@ -41,8 +41,7 @@ static const float phase_changes[] = {0, 1, 6.38264692644, 8.38264692644, 13.76529385288, 15.76529385288, 21.14794077932, 23.14794077932, 28.53058770576, 29.53058770576}; -void moon_phase_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void moon_phase_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(moon_phase_state_t)); @@ -50,12 +49,11 @@ void moon_phase_face_setup(movement_settings_t *settings, uint8_t watch_face_ind } } -void moon_phase_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void moon_phase_face_activate(void *context) { (void) context; } -static void _update(movement_settings_t *settings, moon_phase_state_t *state, uint32_t offset) { +static void _update(moon_phase_state_t *state, uint32_t offset) { (void)state; char buf[11]; watch_date_time date_time = watch_rtc_get_date_time(); @@ -132,23 +130,23 @@ static void _update(movement_settings_t *settings, moon_phase_state_t *state, ui watch_display_string(buf, 2); } -bool moon_phase_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool moon_phase_face_loop(movement_event_t event, void *context) { moon_phase_state_t *state = (moon_phase_state_t *)context; watch_date_time date_time; switch (event.event_type) { case EVENT_ACTIVATE: - _update(settings, state, state->offset); + _update(state, state->offset); break; case EVENT_TICK: // only update once an hour date_time = watch_rtc_get_date_time(); - if ((date_time.unit.minute == 0) && (date_time.unit.second == 0)) _update(settings, state, state->offset); + if ((date_time.unit.minute == 0) && (date_time.unit.second == 0)) _update(state, state->offset); break; case EVENT_LOW_ENERGY_UPDATE: // update at the top of the hour OR if we're entering sleep mode with an offset. // also, in sleep mode, always show the current moon phase (offset = 0). - if (state->offset || (watch_rtc_get_date_time().unit.minute == 0)) _update(settings, state, 0); + if (state->offset || (watch_rtc_get_date_time().unit.minute == 0)) _update(state, 0); // and kill the offset so when the wearer wakes up, it matches what's on screen. state->offset = 0; // finally: clear out the last two digits and replace them with the sleep mode indicator @@ -159,24 +157,23 @@ bool moon_phase_face_loop(movement_event_t event, movement_settings_t *settings, // Pressing the alarm adds an offset of one day to the displayed value, // so you can see moon phases in the future. state->offset += 86400; - _update(settings, state, state->offset); + _update(state, state->offset); break; case EVENT_ALARM_LONG_PRESS: state->offset = 0; - _update(settings, state, state->offset); + _update(state, state->offset); break; case EVENT_TIMEOUT: // QUESTION: Should timeout reset offset to 0? break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void moon_phase_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void moon_phase_face_resign(void *context) { moon_phase_state_t *state = (moon_phase_state_t *)context; state->offset = 0; } diff --git a/movement/watch_faces/complication/moon_phase_face.h b/movement/watch_faces/complication/moon_phase_face.h index 9a64fcc7..b0209829 100644 --- a/movement/watch_faces/complication/moon_phase_face.h +++ b/movement/watch_faces/complication/moon_phase_face.h @@ -55,10 +55,10 @@ typedef struct { uint32_t offset; } moon_phase_state_t; -void moon_phase_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void moon_phase_face_activate(movement_settings_t *settings, void *context); -bool moon_phase_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void moon_phase_face_resign(movement_settings_t *settings, void *context); +void moon_phase_face_setup(uint8_t watch_face_index, void ** context_ptr); +void moon_phase_face_activate(void *context); +bool moon_phase_face_loop(movement_event_t event, void *context); +void moon_phase_face_resign(void *context); #define moon_phase_face ((const watch_face_t){ \ moon_phase_face_setup, \ diff --git a/movement/watch_faces/complication/morsecalc_face.c b/movement/watch_faces/complication/morsecalc_face.c index c92a402b..0a4ad2c0 100644 --- a/movement/watch_faces/complication/morsecalc_face.c +++ b/movement/watch_faces/complication/morsecalc_face.c @@ -106,8 +106,7 @@ void morsecalc_input(morsecalc_state_t * mcs) { return; } -void morsecalc_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void morsecalc_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(morsecalc_state_t)); @@ -122,15 +121,14 @@ void morsecalc_face_setup(movement_settings_t *settings, uint8_t watch_face_inde return; } -void morsecalc_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void morsecalc_face_activate(void *context) { morsecalc_state_t *mcs = (morsecalc_state_t *) context; mcs->mc = 0; morsecalc_display_stack(mcs); return; } -bool morsecalc_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool morsecalc_face_loop(movement_event_t event, void *context) { morsecalc_state_t *mcs = (morsecalc_state_t *) context; switch(event.event_type) { // input @@ -190,15 +188,14 @@ bool morsecalc_face_loop(movement_event_t event, movement_settings_t *settings, // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void morsecalc_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void morsecalc_face_resign(void *context) { morsecalc_state_t *mcs = (morsecalc_state_t *) context; mcs->led_is_on = 0; watch_set_led_off(); diff --git a/movement/watch_faces/complication/morsecalc_face.h b/movement/watch_faces/complication/morsecalc_face.h index 4768cce7..14303472 100644 --- a/movement/watch_faces/complication/morsecalc_face.h +++ b/movement/watch_faces/complication/morsecalc_face.h @@ -136,10 +136,10 @@ */ static const char MORSECODE_TREE[] = " etianmsurwdkgohvf\0l\0pjbxcyzq\0C\x35\x34V\x33\0R\0\x32W\0+\0\0\0\0\x31\x36=/\0\0S(\0\x37\0\0\0\x38\0\x39\x30\0\0\0\0\0E\0\0\0\0\0\0?_\0\0\0\0\"\0\0.\0\0\0\0@\0\0\0'\0\0-\0\0\0\0\0\0\0\0;!\0)\0\0\0\0\0,\0\0\0\0:\0\0\0\0\0\0"; -void morsecalc_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void morsecalc_face_activate(movement_settings_t *settings, void *context); -bool morsecalc_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void morsecalc_face_resign(movement_settings_t *settings, void *context); +void morsecalc_face_setup(uint8_t watch_face_index, void ** context_ptr); +void morsecalc_face_activate(void *context); +bool morsecalc_face_loop(movement_event_t event, void *context); +void morsecalc_face_resign(void *context); typedef struct { calc_state_t *cs; diff --git a/movement/watch_faces/complication/orrery_face.c b/movement/watch_faces/complication/orrery_face.c index 5847b16d..0b538bfe 100644 --- a/movement/watch_faces/complication/orrery_face.c +++ b/movement/watch_faces/complication/orrery_face.c @@ -46,7 +46,7 @@ static const char orrery_celestial_body_names[NUM_AVAILABLE_BODIES][3] = { "NE" // Neptune }; -static void _orrery_face_recalculate(movement_settings_t *settings, orrery_state_t *state) { +static void _orrery_face_recalculate(orrery_state_t *state) { watch_date_time date_time = watch_rtc_get_date_time(); uint32_t timestamp = watch_utility_date_time_to_unix_time(date_time, movement_get_current_timezone_offset()); date_time = watch_utility_date_time_from_unix_time(timestamp, 0); @@ -94,7 +94,7 @@ static void _orrery_face_recalculate(movement_settings_t *settings, orrery_state state->coords[2] = r[2]; } -static void _orrery_face_update(movement_event_t event, movement_settings_t *settings, orrery_state_t *state) { +static void _orrery_face_update(movement_event_t event, orrery_state_t *state) { char buf[11]; switch (state->mode) { case ORRERY_MODE_SELECTING_BODY: @@ -127,7 +127,7 @@ static void _orrery_face_update(movement_event_t event, movement_settings_t *set watch_clear_display(); // this takes a moment and locks the UI, flash C for "Calculating" watch_start_character_blink('C', 100); - _orrery_face_recalculate(settings, state); + _orrery_face_recalculate(state); watch_stop_blink(); state->mode = ORRERY_MODE_DISPLAYING_X; // fall through @@ -149,8 +149,7 @@ static void _orrery_face_update(movement_event_t event, movement_settings_t *set } } -void orrery_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void orrery_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(orrery_state_t)); @@ -158,20 +157,18 @@ void orrery_face_setup(movement_settings_t *settings, uint8_t watch_face_index, } } -void orrery_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void orrery_face_activate(void *context) { (void) context; movement_request_tick_frequency(4); } -bool orrery_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool orrery_face_loop(movement_event_t event, void *context) { orrery_state_t *state = (orrery_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: case EVENT_TICK: - _orrery_face_update(event, settings, state); + _orrery_face_update(event, state); break; case EVENT_ALARM_BUTTON_UP: switch (state->mode) { @@ -191,34 +188,33 @@ bool orrery_face_loop(movement_event_t event, movement_settings_t *settings, voi state->mode++; break; } - _orrery_face_update(event, settings, state); + _orrery_face_update(event, state); break; case EVENT_ALARM_LONG_PRESS: if (state->mode == ORRERY_MODE_SELECTING_BODY) { // celestial body selected! this triggers a calculation in the update method. state->mode = ORRERY_MODE_CALCULATING; movement_request_tick_frequency(1); - _orrery_face_update(event, settings, state); + _orrery_face_update(event, state); } else if (state->mode != ORRERY_MODE_CALCULATING) { // in all modes except "doing a calculation", return to the selection screen. state->mode = ORRERY_MODE_SELECTING_BODY; movement_request_tick_frequency(4); - _orrery_face_update(event, settings, state); + _orrery_face_update(event, state); } break; case EVENT_TIMEOUT: movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void orrery_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void orrery_face_resign(void *context) { orrery_state_t *state = (orrery_state_t *)context; state->mode = ORRERY_MODE_SELECTING_BODY; } diff --git a/movement/watch_faces/complication/orrery_face.h b/movement/watch_faces/complication/orrery_face.h index a416afd0..4bf141e4 100644 --- a/movement/watch_faces/complication/orrery_face.h +++ b/movement/watch_faces/complication/orrery_face.h @@ -85,10 +85,10 @@ typedef struct { uint8_t animation_state; } orrery_state_t; -void orrery_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void orrery_face_activate(movement_settings_t *settings, void *context); -bool orrery_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void orrery_face_resign(movement_settings_t *settings, void *context); +void orrery_face_setup(uint8_t watch_face_index, void ** context_ptr); +void orrery_face_activate(void *context); +bool orrery_face_loop(movement_event_t event, void *context); +void orrery_face_resign(void *context); #define orrery_face ((const watch_face_t){ \ orrery_face_setup, \ diff --git a/movement/watch_faces/complication/periodic_face.c b/movement/watch_faces/complication/periodic_face.c index 90974430..b6a10c2c 100644 --- a/movement/watch_faces/complication/periodic_face.c +++ b/movement/watch_faces/complication/periodic_face.c @@ -36,9 +36,8 @@ static int16_t _text_pos; static const char* _text_looping; static const char title_text[] = "Periodic Table"; -void periodic_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) +void periodic_face_setup(uint8_t watch_face_index, void **context_ptr) { - (void)settings; (void)watch_face_index; if (*context_ptr == NULL) { @@ -47,9 +46,8 @@ void periodic_face_setup(movement_settings_t *settings, uint8_t watch_face_index } } -void periodic_face_activate(movement_settings_t *settings, void *context) +void periodic_face_activate(void *context) { - (void)settings; periodic_state_t *state = (periodic_state_t *)context; state->atomic_num = 0; @@ -390,7 +388,7 @@ static void _handle_mode_still_pressed(periodic_state_t *state, bool should_soun } } -bool periodic_face_loop(movement_event_t event, movement_settings_t *settings, void *context) +bool periodic_face_loop(movement_event_t event, void *context) { periodic_state_t *state = (periodic_state_t *)context; switch (event.event_type) @@ -488,15 +486,14 @@ bool periodic_face_loop(movement_event_t event, movement_settings_t *settings, v watch_start_tick_animation(500); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void periodic_face_resign(movement_settings_t *settings, void *context) +void periodic_face_resign(void *context) { - (void)settings; (void)context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/complication/periodic_face.h b/movement/watch_faces/complication/periodic_face.h index 730b0fe0..409b1d86 100644 --- a/movement/watch_faces/complication/periodic_face.h +++ b/movement/watch_faces/complication/periodic_face.h @@ -72,10 +72,10 @@ typedef struct { uint8_t selection_index; } periodic_state_t; -void periodic_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void periodic_face_activate(movement_settings_t *settings, void *context); -bool periodic_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void periodic_face_resign(movement_settings_t *settings, void *context); +void periodic_face_setup(uint8_t watch_face_index, void ** context_ptr); +void periodic_face_activate(void *context); +bool periodic_face_loop(movement_event_t event, void *context); +void periodic_face_resign(void *context); #define periodic_face ((const watch_face_t){ \ periodic_face_setup, \ diff --git a/movement/watch_faces/complication/planetary_hours_face.c b/movement/watch_faces/complication/planetary_hours_face.c index 466296a6..6d5d9987 100644 --- a/movement/watch_faces/complication/planetary_hours_face.c +++ b/movement/watch_faces/complication/planetary_hours_face.c @@ -113,7 +113,7 @@ static void _planetary_icon(uint8_t planet) { * This function calculates the start and end of the current phase based on a given geographic location. * It also calculates the start of the next following phase. */ -static void _planetary_solar_phases(movement_settings_t *settings, planetary_hours_state_t *state) { +static void _planetary_solar_phases(planetary_hours_state_t *state) { uint8_t phase, h; double sunrise, sunset; double hour_duration, next_hour_duration; @@ -222,7 +222,7 @@ static void _planetary_solar_phases(movement_settings_t *settings, planetary_hou * This function calculates the current planetary hour and divides it up into relative minutes and seconds. * It also calculates the current planetary ruler of the hour and of the day. */ -static void _planetary_hours(movement_settings_t *settings, planetary_hours_state_t *state) { +static void _planetary_hours(planetary_hours_state_t *state) { char buf[14]; char ruler[3]; uint8_t weekday, planet, planetary_hour; @@ -249,7 +249,7 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat // when current phase ends calculate the next phase if ( watch_utility_date_time_to_unix_time(utc_now, 0) >= state->phase_end ) { - _planetary_solar_phases(settings, state); + _planetary_solar_phases(state); return; } @@ -334,17 +334,15 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat // PUBLIC WATCH FACE FUNCTIONS //////////////////////////////////////////////// -void planetary_hours_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void planetary_hours_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; - (void) settings; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(planetary_hours_state_t)); memset(*context_ptr, 0, sizeof(planetary_hours_state_t)); } } -void planetary_hours_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void planetary_hours_face_activate(void *context) { if (watch_tick_animation_is_running()) watch_stop_tick_animation(); #if __EMSCRIPTEN__ @@ -359,11 +357,11 @@ void planetary_hours_face_activate(movement_settings_t *settings, void *context) #endif planetary_hours_state_t *state = (planetary_hours_state_t *)context; - _planetary_solar_phases(settings, state); + _planetary_solar_phases(state); } -bool planetary_hours_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool planetary_hours_face_loop(movement_event_t event, void *context) { planetary_hours_state_t *state = (planetary_hours_state_t *)context; switch (event.event_type) { @@ -371,32 +369,31 @@ bool planetary_hours_face_loop(movement_event_t event, movement_settings_t *sett // Show your initial UI here. watch_clear_indicator(WATCH_INDICATOR_PM); watch_clear_indicator(WATCH_INDICATOR_24H); - _planetary_hours(settings, state); + _planetary_hours(state); break; case EVENT_LIGHT_BUTTON_UP: state->ruler = (state->ruler + 1) % 3; - _planetary_hours(settings, state); + _planetary_hours(state); break; case EVENT_LIGHT_LONG_PRESS: state->skip_to_current = true; - _planetary_hours(settings, state); + _planetary_hours(state); break; case EVENT_ALARM_BUTTON_UP: state->hour++; - _planetary_hours(settings, state); + _planetary_hours(state); break; case EVENT_ALARM_LONG_PRESS: state->hour--; - _planetary_hours(settings, state); + _planetary_hours(state); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void planetary_hours_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void planetary_hours_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/planetary_hours_face.h b/movement/watch_faces/complication/planetary_hours_face.h index dfa6801e..5e94aa00 100644 --- a/movement/watch_faces/complication/planetary_hours_face.h +++ b/movement/watch_faces/complication/planetary_hours_face.h @@ -92,10 +92,10 @@ typedef struct { sunrise_sunset_state_t sunstate; } planetary_hours_state_t; -void planetary_hours_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void planetary_hours_face_activate(movement_settings_t *settings, void *context); -bool planetary_hours_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void planetary_hours_face_resign(movement_settings_t *settings, void *context); +void planetary_hours_face_setup(uint8_t watch_face_index, void ** context_ptr); +void planetary_hours_face_activate(void *context); +bool planetary_hours_face_loop(movement_event_t event, void *context); +void planetary_hours_face_resign(void *context); #define planetary_hours_face ((const watch_face_t){ \ planetary_hours_face_setup, \ diff --git a/movement/watch_faces/complication/planetary_time_face.c b/movement/watch_faces/complication/planetary_time_face.c index 1bad968e..d7b2d611 100644 --- a/movement/watch_faces/complication/planetary_time_face.c +++ b/movement/watch_faces/complication/planetary_time_face.c @@ -112,7 +112,7 @@ static void _planetary_icon(uint8_t planet) { /** @details solar phase can be a day phase between sunrise and sunset or an alternating night phase. * This function calculates the start and end of the current phase based on a given geographic location. */ -static void _planetary_solar_phase(movement_settings_t *settings, planetary_time_state_t *state) { +static void _planetary_solar_phase(planetary_time_state_t *state) { uint8_t phase; double sunrise, sunset; uint32_t now_epoch, sunrise_epoch, sunset_epoch, midnight_epoch; @@ -200,7 +200,7 @@ static void _planetary_solar_phase(movement_settings_t *settings, planetary_time * This function calculates the current planetary hour and divides it up into relative minutes and seconds. * It also calculates the current planetary ruler of the hour and of the day. */ -static void _planetary_time(movement_event_t event, movement_settings_t *settings, planetary_time_state_t *state) { +static void _planetary_time(movement_event_t event, planetary_time_state_t *state) { char buf[14]; char ruler[3]; double night_hour_count = 0.0; @@ -214,7 +214,7 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting // when current phase ends calculate the next phase if ( watch_utility_date_time_to_unix_time(state->scratch, 0) >= state->phase_end ) { - _planetary_solar_phase(settings, state); + _planetary_solar_phase(state); return; } @@ -270,17 +270,15 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting // PUBLIC WATCH FACE FUNCTIONS //////////////////////////////////////////////// -void planetary_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void planetary_time_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; - (void) settings; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(planetary_time_state_t)); memset(*context_ptr, 0, sizeof(planetary_time_state_t)); } } -void planetary_time_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void planetary_time_face_activate(void *context) { if (watch_tick_animation_is_running()) watch_stop_tick_animation(); #if __EMSCRIPTEN__ @@ -297,21 +295,21 @@ void planetary_time_face_activate(movement_settings_t *settings, void *context) planetary_time_state_t *state = (planetary_time_state_t *)context; // calculate phase - _planetary_solar_phase(settings, state); + _planetary_solar_phase(state); } -bool planetary_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool planetary_time_face_loop(movement_event_t event, void *context) { planetary_time_state_t *state = (planetary_time_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: - _planetary_time(event, settings, state); + _planetary_time(event, state); if ( state->freq > 1 ) // for hours with shorter seconds let's increase the tick to not skip seconds in the display movement_request_tick_frequency( 8 ); break; case EVENT_TICK: - _planetary_time(event, settings, state); + _planetary_time(event, state); break; case EVENT_LIGHT_BUTTON_UP: state->ruler = (state->ruler + 1) % 3; @@ -324,14 +322,13 @@ bool planetary_time_face_loop(movement_event_t event, movement_settings_t *setti watch_start_tick_animation(500); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void planetary_time_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void planetary_time_face_resign(void *context) { (void) context; movement_request_tick_frequency( 1 ); } diff --git a/movement/watch_faces/complication/planetary_time_face.h b/movement/watch_faces/complication/planetary_time_face.h index b7e8e807..1acdb11d 100644 --- a/movement/watch_faces/complication/planetary_time_face.h +++ b/movement/watch_faces/complication/planetary_time_face.h @@ -93,10 +93,10 @@ typedef struct { watch_date_time scratch; } planetary_time_state_t; -void planetary_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void planetary_time_face_activate(movement_settings_t *settings, void *context); -bool planetary_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void planetary_time_face_resign(movement_settings_t *settings, void *context); +void planetary_time_face_setup(uint8_t watch_face_index, void ** context_ptr); +void planetary_time_face_activate(void *context); +bool planetary_time_face_loop(movement_event_t event, void *context); +void planetary_time_face_resign(void *context); #define planetary_time_face ((const watch_face_t){ \ planetary_time_face_setup, \ diff --git a/movement/watch_faces/complication/probability_face.c b/movement/watch_faces/complication/probability_face.c index 79427019..56984307 100644 --- a/movement/watch_faces/complication/probability_face.c +++ b/movement/watch_faces/complication/probability_face.c @@ -104,8 +104,7 @@ static void display_dice_roll_animation(probability_state_t *state) { // --------------------------- // Standard watch face methods // --------------------------- -void probability_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void probability_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(probability_state_t)); @@ -117,8 +116,7 @@ void probability_face_setup(movement_settings_t *settings, uint8_t watch_face_in #endif } -void probability_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void probability_face_activate(void *context) { probability_state_t *state = (probability_state_t *)context; state->dice_sides = DEFAULT_DICE_SIDES; @@ -126,8 +124,7 @@ void probability_face_activate(movement_settings_t *settings, void *context) { watch_display_string("PR", 0); } -bool probability_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool probability_face_loop(movement_event_t event, void *context) { probability_state_t *state = (probability_state_t *)context; if (state->is_rolling && event.event_type != EVENT_TICK) { @@ -167,14 +164,13 @@ bool probability_face_loop(movement_event_t event, movement_settings_t *settings watch_display_string("SLEEP ", 4); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void probability_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void probability_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/probability_face.h b/movement/watch_faces/complication/probability_face.h index b2530640..6ce1b1f3 100644 --- a/movement/watch_faces/complication/probability_face.h +++ b/movement/watch_faces/complication/probability_face.h @@ -46,10 +46,10 @@ typedef struct { bool is_rolling; } probability_state_t; -void probability_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void probability_face_activate(movement_settings_t *settings, void *context); -bool probability_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void probability_face_resign(movement_settings_t *settings, void *context); +void probability_face_setup(uint8_t watch_face_index, void ** context_ptr); +void probability_face_activate(void *context); +bool probability_face_loop(movement_event_t event, void *context); +void probability_face_resign(void *context); #define probability_face ((const watch_face_t){ \ probability_face_setup, \ diff --git a/movement/watch_faces/complication/pulsometer_face.c b/movement/watch_faces/complication/pulsometer_face.c index 2141b69a..1c29080c 100644 --- a/movement/watch_faces/complication/pulsometer_face.c +++ b/movement/watch_faces/complication/pulsometer_face.c @@ -134,8 +134,7 @@ static void pulsometer_cycle_calibration(pulsometer_state_t *pulsometer, int8_t pulsometer_display_calibration(pulsometer); } -void pulsometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void pulsometer_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -149,8 +148,7 @@ void pulsometer_face_setup(movement_settings_t *settings, uint8_t watch_face_ind } } -void pulsometer_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void pulsometer_face_activate(void *context) { pulsometer_state_t *pulsometer = context; @@ -161,8 +159,7 @@ void pulsometer_face_activate(movement_settings_t *settings, void *context) { pulsometer_display_measurement(pulsometer); } -bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool pulsometer_face_loop(movement_event_t event, void *context) { pulsometer_state_t *pulsometer = (pulsometer_state_t *) context; @@ -190,14 +187,13 @@ bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void pulsometer_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void pulsometer_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/pulsometer_face.h b/movement/watch_faces/complication/pulsometer_face.h index 5c1dae91..78c906cf 100644 --- a/movement/watch_faces/complication/pulsometer_face.h +++ b/movement/watch_faces/complication/pulsometer_face.h @@ -71,10 +71,10 @@ #include "movement.h" -void pulsometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void pulsometer_face_activate(movement_settings_t *settings, void *context); -bool pulsometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void pulsometer_face_resign(movement_settings_t *settings, void *context); +void pulsometer_face_setup(uint8_t watch_face_index, void ** context_ptr); +void pulsometer_face_activate(void *context); +bool pulsometer_face_loop(movement_event_t event, void *context); +void pulsometer_face_resign(void *context); #define pulsometer_face ((const watch_face_t){ \ pulsometer_face_setup, \ diff --git a/movement/watch_faces/complication/randonaut_face.c b/movement/watch_faces/complication/randonaut_face.c index 3bbc147f..d070555a 100644 --- a/movement/watch_faces/complication/randonaut_face.c +++ b/movement/watch_faces/complication/randonaut_face.c @@ -50,8 +50,7 @@ static void _get_entropy(randonaut_state_t *state); // MOVEMENT WATCH FACE FUNCTIONS ////////////////////////////////////////////// -void randonaut_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void randonaut_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(randonaut_state_t)); @@ -61,8 +60,7 @@ void randonaut_face_setup(movement_settings_t *settings, uint8_t watch_face_inde // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void randonaut_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void randonaut_face_activate(void *context) { randonaut_state_t *state = (randonaut_state_t *)context; _get_location_from_file(state); state->face.mode = 0; @@ -72,7 +70,7 @@ void randonaut_face_activate(movement_settings_t *settings, void *context) { // Handle any tasks related to your watch face coming on screen. } -bool randonaut_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool randonaut_face_loop(movement_event_t event, void *context) { randonaut_state_t *state = (randonaut_state_t *)context; switch (event.event_type) { @@ -178,7 +176,7 @@ bool randonaut_face_loop(movement_event_t event, movement_settings_t *settings, // * EVENT_MODE_BUTTON_UP moves to the next watch face in the list // * EVENT_MODE_LONG_PRESS returns to the first watch face (or skips to the secondary watch face, if configured) // You can override any of these behaviors by adding a case for these events to this switch statement. - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } _randonaut_face_display(state); @@ -192,8 +190,7 @@ bool randonaut_face_loop(movement_event_t event, movement_settings_t *settings, return true; } -void randonaut_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void randonaut_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/complication/randonaut_face.h b/movement/watch_faces/complication/randonaut_face.h index 2f18d45a..72e47261 100644 --- a/movement/watch_faces/complication/randonaut_face.h +++ b/movement/watch_faces/complication/randonaut_face.h @@ -96,10 +96,10 @@ typedef struct { char scratchpad[10]; } randonaut_state_t; -void randonaut_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void randonaut_face_activate(movement_settings_t *settings, void *context); -bool randonaut_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void randonaut_face_resign(movement_settings_t *settings, void *context); +void randonaut_face_setup(uint8_t watch_face_index, void ** context_ptr); +void randonaut_face_activate(void *context); +bool randonaut_face_loop(movement_event_t event, void *context); +void randonaut_face_resign(void *context); #define randonaut_face ((const watch_face_t){ \ randonaut_face_setup, \ diff --git a/movement/watch_faces/complication/ratemeter_face.c b/movement/watch_faces/complication/ratemeter_face.c index 8ae80515..746ab396 100644 --- a/movement/watch_faces/complication/ratemeter_face.c +++ b/movement/watch_faces/complication/ratemeter_face.c @@ -30,19 +30,16 @@ #define RATEMETER_FACE_FREQUENCY_FACTOR (4ul) // refresh rate will be 2 to this power Hz (0 for 1 Hz, 2 for 4 Hz, etc.) #define RATEMETER_FACE_FREQUENCY (1 << RATEMETER_FACE_FREQUENCY_FACTOR) -void ratemeter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void ratemeter_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) *context_ptr = malloc(sizeof(ratemeter_state_t)); } -void ratemeter_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void ratemeter_face_activate(void *context) { memset(context, 0, sizeof(ratemeter_state_t)); } -bool ratemeter_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool ratemeter_face_loop(movement_event_t event, void *context) { ratemeter_state_t *ratemeter_state = (ratemeter_state_t *)context; char buf[14]; switch (event.event_type) { @@ -79,14 +76,13 @@ bool ratemeter_face_loop(movement_event_t event, movement_settings_t *settings, movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void ratemeter_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void ratemeter_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/ratemeter_face.h b/movement/watch_faces/complication/ratemeter_face.h index 4b10c0f9..85ac2554 100644 --- a/movement/watch_faces/complication/ratemeter_face.h +++ b/movement/watch_faces/complication/ratemeter_face.h @@ -42,10 +42,10 @@ typedef struct { int16_t ticks; } ratemeter_state_t; -void ratemeter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void ratemeter_face_activate(movement_settings_t *settings, void *context); -bool ratemeter_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void ratemeter_face_resign(movement_settings_t *settings, void *context); +void ratemeter_face_setup(uint8_t watch_face_index, void ** context_ptr); +void ratemeter_face_activate(void *context); +bool ratemeter_face_loop(movement_event_t event, void *context); +void ratemeter_face_resign(void *context); #define ratemeter_face ((const watch_face_t){ \ ratemeter_face_setup, \ diff --git a/movement/watch_faces/complication/rpn_calculator_alt_face.c b/movement/watch_faces/complication/rpn_calculator_alt_face.c index 4a191b7e..03a75ec8 100644 --- a/movement/watch_faces/complication/rpn_calculator_alt_face.c +++ b/movement/watch_faces/complication/rpn_calculator_alt_face.c @@ -30,8 +30,7 @@ static void show_fn(calculator_state_t *state, uint8_t subsecond); -void rpn_calculator_alt_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void rpn_calculator_alt_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -125,8 +124,7 @@ static void show_number(double num) { #define PUSH(x) (s->stack[++s->stack_size - 1] = x) #define POP() (s->stack[s->stack_size-- - 1]) -void rpn_calculator_alt_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void rpn_calculator_alt_face_activate(void *context) { calculator_state_t *s = (calculator_state_t *)context; s->min = s->max = NAN; } @@ -344,9 +342,8 @@ static void show_stack_top(calculator_state_t *s) { } } -bool rpn_calculator_alt_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool rpn_calculator_alt_face_loop(movement_event_t event, void *context) { calculator_state_t *s = (calculator_state_t *)context; - (void) settings; int proposed_stack_size; @@ -410,7 +407,7 @@ bool rpn_calculator_alt_face_loop(movement_event_t event, movement_settings_t *s case EVENT_LOW_ENERGY_UPDATE: break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } @@ -419,8 +416,7 @@ bool rpn_calculator_alt_face_loop(movement_event_t event, movement_settings_t *s return true; } -void rpn_calculator_alt_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void rpn_calculator_alt_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/complication/rpn_calculator_alt_face.h b/movement/watch_faces/complication/rpn_calculator_alt_face.h index bb4fd7d0..4e74115a 100644 --- a/movement/watch_faces/complication/rpn_calculator_alt_face.h +++ b/movement/watch_faces/complication/rpn_calculator_alt_face.h @@ -79,10 +79,10 @@ typedef struct { enum calculator_mode mode; } calculator_state_t; -void rpn_calculator_alt_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void rpn_calculator_alt_face_activate(movement_settings_t *settings, void *context); -bool rpn_calculator_alt_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void rpn_calculator_alt_face_resign(movement_settings_t *settings, void *context); +void rpn_calculator_alt_face_setup(uint8_t watch_face_index, void ** context_ptr); +void rpn_calculator_alt_face_activate(void *context); +bool rpn_calculator_alt_face_loop(movement_event_t event, void *context); +void rpn_calculator_alt_face_resign(void *context); #define rpn_calculator_alt_face ((const watch_face_t){ \ rpn_calculator_alt_face_setup, \ diff --git a/movement/watch_faces/complication/rpn_calculator_face.c b/movement/watch_faces/complication/rpn_calculator_face.c index e1b2dfd8..2c5a8835 100644 --- a/movement/watch_faces/complication/rpn_calculator_face.c +++ b/movement/watch_faces/complication/rpn_calculator_face.c @@ -232,8 +232,7 @@ static void draw(rpn_calculator_state_t *state, uint8_t subsecond) { watch_display_string(buf, 0); } -void rpn_calculator_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void rpn_calculator_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(rpn_calculator_state_t)); @@ -245,15 +244,13 @@ void rpn_calculator_face_setup(movement_settings_t *settings, uint8_t watch_face // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void rpn_calculator_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void rpn_calculator_face_activate(void *context) { (void) context; // Handle any tasks related to your watch face coming on screen. } -bool rpn_calculator_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool rpn_calculator_face_loop(movement_event_t event, void *context) { rpn_calculator_state_t *state = (rpn_calculator_state_t *)context; @@ -333,7 +330,7 @@ bool rpn_calculator_face_loop(movement_event_t event, movement_settings_t *setti case EVENT_LOW_ENERGY_UPDATE: break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } @@ -342,8 +339,7 @@ bool rpn_calculator_face_loop(movement_event_t event, movement_settings_t *setti return true; } -void rpn_calculator_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void rpn_calculator_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/complication/rpn_calculator_face.h b/movement/watch_faces/complication/rpn_calculator_face.h index 57b59a27..a9daad61 100644 --- a/movement/watch_faces/complication/rpn_calculator_face.h +++ b/movement/watch_faces/complication/rpn_calculator_face.h @@ -64,10 +64,10 @@ typedef struct { uint8_t selection; } rpn_calculator_state_t; -void rpn_calculator_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void rpn_calculator_face_activate(movement_settings_t *settings, void *context); -bool rpn_calculator_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void rpn_calculator_face_resign(movement_settings_t *settings, void *context); +void rpn_calculator_face_setup(uint8_t watch_face_index, void ** context_ptr); +void rpn_calculator_face_activate(void *context); +bool rpn_calculator_face_loop(movement_event_t event, void *context); +void rpn_calculator_face_resign(void *context); #define rpn_calculator_face ((const watch_face_t){ \ rpn_calculator_face_setup, \ diff --git a/movement/watch_faces/complication/sailing_face.c b/movement/watch_faces/complication/sailing_face.c index 8d39fc36..32c6fa6f 100644 --- a/movement/watch_faces/complication/sailing_face.c +++ b/movement/watch_faces/complication/sailing_face.c @@ -33,7 +33,7 @@ #define sl_SELECTIONS 6 #define DEFAULT_MINUTES { 5,4,1,0,0,0 } -static inline int32_t get_tz_offset(movement_settings_t *settings) { +static inline int32_t get_tz_offset() { return movement_get_current_timezone_offset(); } @@ -62,8 +62,7 @@ static void counting(sailing_state_t *state) { watch_set_indicator(WATCH_INDICATOR_LAP); } -static void draw(sailing_state_t *state, uint8_t subsecond, movement_settings_t *settings) { - (void) settings; +static void draw(sailing_state_t *state, uint8_t subsecond) { char tmp[24]; char buf[16]; @@ -152,7 +151,7 @@ static void draw(sailing_state_t *state, uint8_t subsecond, movement_settings_t watch_display_string(buf, 0); } -static void ring(sailing_state_t *state, movement_settings_t *settings) { +static void ring(sailing_state_t *state) { // if ring is called in background (while on another face), a button press can interrupt and cancel the execution. // To reduce the probability of cancelling all future alarms, the new alarm is set as soon as possible after calling ring. movement_cancel_background_task(); @@ -185,7 +184,7 @@ static void ring(sailing_state_t *state, movement_settings_t *settings) { beepflag++; } -static void start(sailing_state_t *state, movement_settings_t *settings) {//gets called by starting / switching to next signal +static void start(sailing_state_t *state) {//gets called by starting / switching to next signal while (beepseconds[beepflag] < state->minutes[state->index]*60) { state->index++; } @@ -234,8 +233,7 @@ static void settings_increment(sailing_state_t *state) { return; } -void sailing_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void sailing_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -248,8 +246,7 @@ void sailing_face_setup(movement_settings_t *settings, uint8_t watch_face_index, } } -void sailing_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void sailing_face_activate(void *context) { sailing_state_t *state = (sailing_state_t *)context; if(state->mode == sl_running) { watch_date_time now = watch_rtc_get_date_time(); @@ -281,8 +278,7 @@ void sailing_face_activate(movement_settings_t *settings, void *context) { } -bool sailing_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool sailing_face_loop(movement_event_t event, void *context) { sailing_state_t *state = (sailing_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: @@ -397,15 +393,14 @@ bool sailing_face_loop(movement_event_t event, movement_settings_t *settings, vo // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void sailing_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void sailing_face_resign(void *context) { sailing_state_t *state = (sailing_state_t *)context; if (state->mode == sl_setting) { state->selection = 0; diff --git a/movement/watch_faces/complication/sailing_face.h b/movement/watch_faces/complication/sailing_face.h index 5546f275..b9a5cfae 100644 --- a/movement/watch_faces/complication/sailing_face.h +++ b/movement/watch_faces/complication/sailing_face.h @@ -81,10 +81,10 @@ typedef struct { } sailing_state_t; -void sailing_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void sailing_face_activate(movement_settings_t *settings, void *context); -bool sailing_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void sailing_face_resign(movement_settings_t *settings, void *context); +void sailing_face_setup(uint8_t watch_face_index, void ** context_ptr); +void sailing_face_activate(void *context); +bool sailing_face_loop(movement_event_t event, void *context); +void sailing_face_resign(void *context); #define sailing_face ((const watch_face_t){ \ sailing_face_setup, \ diff --git a/movement/watch_faces/complication/ships_bell_face.c b/movement/watch_faces/complication/ships_bell_face.c index 3ce11f90..6efbc52a 100644 --- a/movement/watch_faces/complication/ships_bell_face.c +++ b/movement/watch_faces/complication/ships_bell_face.c @@ -61,8 +61,7 @@ static void ships_bell_draw(ships_bell_state_t *state) { watch_display_string(buf, 3); } -void ships_bell_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) { - (void) settings; +void ships_bell_face_setup(uint8_t watch_face_index, void **context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -71,8 +70,7 @@ void ships_bell_face_setup(movement_settings_t *settings, uint8_t watch_face_ind } } -void ships_bell_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void ships_bell_face_activate(void *context) { ships_bell_state_t *state = (ships_bell_state_t *) context; if (state->bell_enabled) watch_set_indicator(WATCH_INDICATOR_BELL); @@ -82,8 +80,7 @@ void ships_bell_face_activate(movement_settings_t *settings, void *context) { watch_set_colon(); } -bool ships_bell_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool ships_bell_face_loop(movement_event_t event, void *context) { ships_bell_state_t *state = (ships_bell_state_t *) context; @@ -116,20 +113,18 @@ bool ships_bell_face_loop(movement_event_t event, movement_settings_t *settings, } break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void ships_bell_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void ships_bell_face_resign(void *context) { (void) context; } -bool ships_bell_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool ships_bell_face_wants_background_task(void *context) { ships_bell_state_t *state = (ships_bell_state_t *) context; if (!state->bell_enabled) return false; diff --git a/movement/watch_faces/complication/ships_bell_face.h b/movement/watch_faces/complication/ships_bell_face.h index 3a04b938..7a17bd4d 100644 --- a/movement/watch_faces/complication/ships_bell_face.h +++ b/movement/watch_faces/complication/ships_bell_face.h @@ -51,11 +51,11 @@ typedef struct { uint8_t on_watch; } ships_bell_state_t; -void ships_bell_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void ships_bell_face_activate(movement_settings_t *settings, void *context); -bool ships_bell_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void ships_bell_face_resign(movement_settings_t *settings, void *context); -bool ships_bell_face_wants_background_task(movement_settings_t *settings, void *context); +void ships_bell_face_setup(uint8_t watch_face_index, void ** context_ptr); +void ships_bell_face_activate(void *context); +bool ships_bell_face_loop(movement_event_t event, void *context); +void ships_bell_face_resign(void *context); +bool ships_bell_face_wants_background_task(void *context); #define ships_bell_face ((const watch_face_t){ \ ships_bell_face_setup, \ diff --git a/movement/watch_faces/complication/simon_face.c b/movement/watch_faces/complication/simon_face.c index eb08f17a..41bc5c3d 100644 --- a/movement/watch_faces/complication/simon_face.c +++ b/movement/watch_faces/complication/simon_face.c @@ -201,9 +201,8 @@ static void _simon_change_speed(simon_state_t *state){ } } -void simon_face_setup(movement_settings_t *settings, uint8_t watch_face_index, +void simon_face_setup(uint8_t watch_face_index, void **context_ptr) { - (void)settings; (void)watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(simon_state_t)); @@ -220,7 +219,7 @@ void simon_face_setup(movement_settings_t *settings, uint8_t watch_face_index, #endif } -void simon_face_activate(movement_settings_t *settings, void *context) { +void simon_face_activate(void *context) { (void) settings; (void) context; simon_state_t *state = (simon_state_t *)context; @@ -229,7 +228,7 @@ void simon_face_activate(movement_settings_t *settings, void *context) { _timer = 0; } -bool simon_face_loop(movement_event_t event, movement_settings_t *settings, +bool simon_face_loop(movement_event_t event, void *context) { simon_state_t *state = (simon_state_t *)context; @@ -321,14 +320,13 @@ bool simon_face_loop(movement_event_t event, movement_settings_t *settings, case EVENT_LOW_ENERGY_UPDATE: break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void simon_face_resign(movement_settings_t *settings, void *context) { - (void)settings; +void simon_face_resign(void *context) { (void)context; watch_set_led_off(); watch_set_buzzer_off(); diff --git a/movement/watch_faces/complication/simon_face.h b/movement/watch_faces/complication/simon_face.h index 44bc9f3c..63e83895 100644 --- a/movement/watch_faces/complication/simon_face.h +++ b/movement/watch_faces/complication/simon_face.h @@ -90,10 +90,10 @@ typedef struct { SimonPlayingState playing_state; } simon_state_t; -void simon_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr); -void simon_face_activate(movement_settings_t *settings, void *context); -bool simon_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void simon_face_resign(movement_settings_t *settings, void *context); +void simon_face_setup(uint8_t watch_face_index, void **context_ptr); +void simon_face_activate(void *context); +bool simon_face_loop(movement_event_t event, void *context); +void simon_face_resign(void *context); #define simon_face \ ((const watch_face_t){ \ diff --git a/movement/watch_faces/complication/simple_calculator_face.c b/movement/watch_faces/complication/simple_calculator_face.c index 53fdd87d..7c849cd4 100644 --- a/movement/watch_faces/complication/simple_calculator_face.c +++ b/movement/watch_faces/complication/simple_calculator_face.c @@ -27,8 +27,7 @@ #include #include "simple_calculator_face.h" -void simple_calculator_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void simple_calculator_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(simple_calculator_state_t)); @@ -46,8 +45,7 @@ static void reset_to_zero(calculator_number_t *number) { number->thousands = 0; } -void simple_calculator_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void simple_calculator_face_activate(void *context) { simple_calculator_state_t *state = (simple_calculator_state_t *)context; state->placeholder = PLACEHOLDER_ONES; state->mode = MODE_ENTERING_FIRST_NUM; @@ -266,7 +264,7 @@ static void reset_all(simple_calculator_state_t *state) { state->placeholder = PLACEHOLDER_ONES; } -bool simple_calculator_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool simple_calculator_face_loop(movement_event_t event, void *context) { simple_calculator_state_t *state = (simple_calculator_state_t *)context; char display_string[10]; char temp_display_string[10]; // Temporary buffer for blinking effect @@ -451,14 +449,13 @@ bool simple_calculator_face_loop(movement_event_t event, movement_settings_t *se break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void simple_calculator_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void simple_calculator_face_resign(void *context) { (void) context; movement_request_tick_frequency(1); } diff --git a/movement/watch_faces/complication/simple_calculator_face.h b/movement/watch_faces/complication/simple_calculator_face.h index 1f77dc08..8a8ea020 100644 --- a/movement/watch_faces/complication/simple_calculator_face.h +++ b/movement/watch_faces/complication/simple_calculator_face.h @@ -128,10 +128,10 @@ typedef struct { calculator_placeholder_t placeholder; } simple_calculator_state_t; -void simple_calculator_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void simple_calculator_face_activate(movement_settings_t *settings, void *context); -bool simple_calculator_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void simple_calculator_face_resign(movement_settings_t *settings, void *context); +void simple_calculator_face_setup(uint8_t watch_face_index, void ** context_ptr); +void simple_calculator_face_activate(void *context); +bool simple_calculator_face_loop(movement_event_t event, void *context); +void simple_calculator_face_resign(void *context); #define simple_calculator_face ((const watch_face_t){ \ simple_calculator_face_setup, \ diff --git a/movement/watch_faces/complication/simple_coin_flip_face.c b/movement/watch_faces/complication/simple_coin_flip_face.c index 64431f9d..7e0003f3 100644 --- a/movement/watch_faces/complication/simple_coin_flip_face.c +++ b/movement/watch_faces/complication/simple_coin_flip_face.c @@ -34,8 +34,7 @@ #define SIMPLE_COIN_FLIP_REQUIRE_LONG_PRESS_FOR_REFLIP true -void simple_coin_flip_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void simple_coin_flip_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(simple_coin_flip_state_t)); @@ -43,8 +42,7 @@ void simple_coin_flip_face_setup(movement_settings_t *settings, uint8_t watch_fa } } -void simple_coin_flip_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void simple_coin_flip_face_activate(void *context) { (void) context; } @@ -74,7 +72,7 @@ static void animation_2() { watch_set_pixel(2, 4); } -bool simple_coin_flip_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool simple_coin_flip_face_loop(movement_event_t event, void *context) { simple_coin_flip_state_t *state = (simple_coin_flip_state_t *)context; switch (event.event_type) { @@ -126,14 +124,13 @@ bool simple_coin_flip_face_loop(movement_event_t event, movement_settings_t *set movement_move_to_face(0); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void simple_coin_flip_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void simple_coin_flip_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/simple_coin_flip_face.h b/movement/watch_faces/complication/simple_coin_flip_face.h index f5e223b8..710acca5 100644 --- a/movement/watch_faces/complication/simple_coin_flip_face.h +++ b/movement/watch_faces/complication/simple_coin_flip_face.h @@ -45,10 +45,10 @@ typedef struct { uint8_t animation_frame; } simple_coin_flip_state_t; -void simple_coin_flip_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void simple_coin_flip_face_activate(movement_settings_t *settings, void *context); -bool simple_coin_flip_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void simple_coin_flip_face_resign(movement_settings_t *settings, void *context); +void simple_coin_flip_face_setup(uint8_t watch_face_index, void ** context_ptr); +void simple_coin_flip_face_activate(void *context); +bool simple_coin_flip_face_loop(movement_event_t event, void *context); +void simple_coin_flip_face_resign(void *context); #define simple_coin_flip_face ((const watch_face_t){ \ simple_coin_flip_face_setup, \ diff --git a/movement/watch_faces/complication/smallchess_face.c b/movement/watch_faces/complication/smallchess_face.c index df700640..65838724 100644 --- a/movement/watch_faces/complication/smallchess_face.c +++ b/movement/watch_faces/complication/smallchess_face.c @@ -40,8 +40,7 @@ static void smallchess_init_board(smallchess_face_state_t *state) { memset(state->moveable_dests, 0xff, sizeof(state->moveable_dests)); } -void smallchess_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void smallchess_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(smallchess_face_state_t)); @@ -54,8 +53,7 @@ void smallchess_face_setup(movement_settings_t *settings, uint8_t watch_face_ind } } -void smallchess_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void smallchess_face_activate(void *context) { (void) context; } @@ -463,8 +461,7 @@ static void _smallchess_handle_button_event(smallchess_face_state_t *state, move } } -bool smallchess_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool smallchess_face_loop(movement_event_t event, void *context) { smallchess_face_state_t *state = (smallchess_face_state_t *)context; switch (event.event_type) { @@ -490,15 +487,14 @@ bool smallchess_face_loop(movement_event_t event, movement_settings_t *settings, case EVENT_LIGHT_BUTTON_DOWN: break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void smallchess_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void smallchess_face_resign(void *context) { (void) context; watch_set_led_off(); } diff --git a/movement/watch_faces/complication/smallchess_face.h b/movement/watch_faces/complication/smallchess_face.h index 2eb0786c..97d8179e 100644 --- a/movement/watch_faces/complication/smallchess_face.h +++ b/movement/watch_faces/complication/smallchess_face.h @@ -74,10 +74,10 @@ typedef struct { uint8_t ai_from_square, ai_to_square; } smallchess_face_state_t; -void smallchess_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void smallchess_face_activate(movement_settings_t *settings, void *context); -bool smallchess_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void smallchess_face_resign(movement_settings_t *settings, void *context); +void smallchess_face_setup(uint8_t watch_face_index, void ** context_ptr); +void smallchess_face_activate(void *context); +bool smallchess_face_loop(movement_event_t event, void *context); +void smallchess_face_resign(void *context); #define smallchess_face ((const watch_face_t){ \ smallchess_face_setup, \ diff --git a/movement/watch_faces/complication/solstice_face.c b/movement/watch_faces/complication/solstice_face.c index 66fe210e..58139f4e 100644 --- a/movement/watch_faces/complication/solstice_face.c +++ b/movement/watch_faces/complication/solstice_face.c @@ -122,15 +122,14 @@ static watch_date_time jde_to_date_time(double JDE) { return result; } -static void calculate_datetimes(solstice_state_t *state, movement_settings_t *settings) { +static void calculate_datetimes(solstice_state_t *state) { for (int i = 0; i < 4; i++) { // TODO: handle DST changes state->datetimes[i] = jde_to_date_time(calculate_solstice_equinox(2020 + state->year, i) + (movement_get_current_timezone_offset() / (3600.0*24.0))); } } -void solstice_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void solstice_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(solstice_state_t)); @@ -150,8 +149,7 @@ void solstice_face_setup(movement_settings_t *settings, uint8_t watch_face_index } } -void solstice_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void solstice_face_activate(void *context) { (void) context; } @@ -162,7 +160,7 @@ static void show_main_screen(solstice_state_t *state) { watch_display_string(buf, 0); } -static void show_date_time(movement_settings_t *settings, solstice_state_t *state) { +static void show_date_time(solstice_state_t *state) { char buf[11]; watch_date_time date_time = state->datetimes[state->index]; if (!movement_clock_mode_24h()) { @@ -179,12 +177,12 @@ static void show_date_time(movement_settings_t *settings, solstice_state_t *stat watch_display_string(buf, 0); } -bool solstice_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool solstice_face_loop(movement_event_t event, void *context) { solstice_state_t *state = (solstice_state_t *)context; switch (event.event_type) { case EVENT_ALARM_LONG_PRESS: - show_date_time(settings, state); + show_date_time(state); break; case EVENT_LIGHT_BUTTON_UP: if (state->index == 0) { @@ -223,14 +221,13 @@ bool solstice_face_loop(movement_event_t event, movement_settings_t *settings, v movement_move_to_face(0); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void solstice_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void solstice_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/solstice_face.h b/movement/watch_faces/complication/solstice_face.h index ec537c09..17e630d4 100644 --- a/movement/watch_faces/complication/solstice_face.h +++ b/movement/watch_faces/complication/solstice_face.h @@ -47,10 +47,10 @@ typedef struct { uint8_t index; } solstice_state_t; -void solstice_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void solstice_face_activate(movement_settings_t *settings, void *context); -bool solstice_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void solstice_face_resign(movement_settings_t *settings, void *context); +void solstice_face_setup(uint8_t watch_face_index, void ** context_ptr); +void solstice_face_activate(void *context); +bool solstice_face_loop(movement_event_t event, void *context); +void solstice_face_resign(void *context); #define solstice_face ((const watch_face_t){ \ solstice_face_setup, \ diff --git a/movement/watch_faces/complication/stock_stopwatch_face.c b/movement/watch_faces/complication/stock_stopwatch_face.c index 8e7e3941..d4a0de79 100644 --- a/movement/watch_faces/complication/stock_stopwatch_face.c +++ b/movement/watch_faces/complication/stock_stopwatch_face.c @@ -123,7 +123,7 @@ void TC2_Handler(void) { #endif -static inline void _button_beep(movement_settings_t *settings) { +static inline void _button_beep() { // play a beep as confirmation for a button press (if applicable) if (movement_button_should_sound()) watch_buzzer_play_note(BUZZER_NOTE_C7, 50); } @@ -202,8 +202,7 @@ static inline void _set_colon() { _colon = true; } -void stock_stopwatch_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void stock_stopwatch_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(stock_stopwatch_state_t)); @@ -219,8 +218,7 @@ void stock_stopwatch_face_setup(movement_settings_t *settings, uint8_t watch_fac } } -void stock_stopwatch_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void stock_stopwatch_face_activate(void *context) { (void) context; if (_is_running) { // The background task will keep the watch from entering low energy mode while the stopwatch is on screen. @@ -228,7 +226,7 @@ void stock_stopwatch_face_activate(movement_settings_t *settings, void *context) } } -bool stock_stopwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool stock_stopwatch_face_loop(movement_event_t event, void *context) { stock_stopwatch_state_t *state = (stock_stopwatch_state_t *)context; // handle overflow of fast ticks @@ -310,14 +308,13 @@ bool stock_stopwatch_face_loop(movement_event_t event, movement_settings_t *sett _draw(); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void stock_stopwatch_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void stock_stopwatch_face_resign(void *context) { (void) context; // cancel the keepalive task movement_cancel_background_task(); diff --git a/movement/watch_faces/complication/stock_stopwatch_face.h b/movement/watch_faces/complication/stock_stopwatch_face.h index 6796a849..349c166a 100644 --- a/movement/watch_faces/complication/stock_stopwatch_face.h +++ b/movement/watch_faces/complication/stock_stopwatch_face.h @@ -58,10 +58,10 @@ typedef struct { bool light_on_button; // determines whether the light button actually triggers the led } stock_stopwatch_state_t; -void stock_stopwatch_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void stock_stopwatch_face_activate(movement_settings_t *settings, void *context); -bool stock_stopwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void stock_stopwatch_face_resign(movement_settings_t *settings, void *context); +void stock_stopwatch_face_setup(uint8_t watch_face_index, void ** context_ptr); +void stock_stopwatch_face_activate(void *context); +bool stock_stopwatch_face_loop(movement_event_t event, void *context); +void stock_stopwatch_face_resign(void *context); #if __EMSCRIPTEN__ void em_cb_handler(void *userData); diff --git a/movement/watch_faces/complication/stopwatch_face.c b/movement/watch_faces/complication/stopwatch_face.c index 9931e1c4..fc9550fa 100644 --- a/movement/watch_faces/complication/stopwatch_face.c +++ b/movement/watch_faces/complication/stopwatch_face.c @@ -35,8 +35,7 @@ static const watch_date_time distant_future = { .unit = {0, 0, 0, 1, 1, 63} }; -void stopwatch_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void stopwatch_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(stopwatch_state_t)); @@ -77,8 +76,7 @@ static void _stopwatch_face_update_display(stopwatch_state_t *stopwatch_state, b } } -void stopwatch_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void stopwatch_face_activate(void *context) { if (watch_tick_animation_is_running()) watch_stop_tick_animation(); stopwatch_state_t *stopwatch_state = (stopwatch_state_t *)context; @@ -93,7 +91,7 @@ void stopwatch_face_activate(movement_settings_t *settings, void *context) { } } -bool stopwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool stopwatch_face_loop(movement_event_t event, void *context) { stopwatch_state_t *stopwatch_state = (stopwatch_state_t *)context; switch (event.event_type) { @@ -158,14 +156,13 @@ bool stopwatch_face_loop(movement_event_t event, movement_settings_t *settings, } break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void stopwatch_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void stopwatch_face_resign(void *context) { (void) context; // regardless of whether we're running or stopped, cancel the task diff --git a/movement/watch_faces/complication/stopwatch_face.h b/movement/watch_faces/complication/stopwatch_face.h index 7bdf19c6..e3056283 100644 --- a/movement/watch_faces/complication/stopwatch_face.h +++ b/movement/watch_faces/complication/stopwatch_face.h @@ -45,10 +45,10 @@ typedef struct { uint32_t seconds_counted; // set this value when paused, and show that instead. } stopwatch_state_t; -void stopwatch_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void stopwatch_face_activate(movement_settings_t *settings, void *context); -bool stopwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void stopwatch_face_resign(movement_settings_t *settings, void *context); +void stopwatch_face_setup(uint8_t watch_face_index, void ** context_ptr); +void stopwatch_face_activate(void *context); +bool stopwatch_face_loop(movement_event_t event, void *context); +void stopwatch_face_resign(void *context); #define stopwatch_face ((const watch_face_t){ \ stopwatch_face_setup, \ diff --git a/movement/watch_faces/complication/sunrise_sunset_face.c b/movement/watch_faces/complication/sunrise_sunset_face.c index 5fd77889..fa300cf9 100644 --- a/movement/watch_faces/complication/sunrise_sunset_face.c +++ b/movement/watch_faces/complication/sunrise_sunset_face.c @@ -44,7 +44,7 @@ static void _sunrise_sunset_set_expiration(sunrise_sunset_state_t *state, watch_ state->rise_set_expires = watch_utility_date_time_from_unix_time(timestamp + 60, 0); } -static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_sunset_state_t *state) { +static void _sunrise_sunset_face_update(sunrise_sunset_state_t *state) { char buf[14]; double rise, set, minutes, seconds; bool show_next_match = false; @@ -291,8 +291,7 @@ static void _sunrise_sunset_face_advance_digit(sunrise_sunset_state_t *state) { } } -void sunrise_sunset_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void sunrise_sunset_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(sunrise_sunset_state_t)); @@ -300,8 +299,7 @@ void sunrise_sunset_face_setup(movement_settings_t *settings, uint8_t watch_face } } -void sunrise_sunset_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void sunrise_sunset_face_activate(void *context) { if (watch_tick_animation_is_running()) watch_stop_tick_animation(); #if __EMSCRIPTEN__ @@ -326,12 +324,12 @@ void sunrise_sunset_face_activate(movement_settings_t *settings, void *context) state->working_longitude = _sunrise_sunset_face_struct_from_latlon(movement_location.bit.longitude); } -bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool sunrise_sunset_face_loop(movement_event_t event, void *context) { sunrise_sunset_state_t *state = (sunrise_sunset_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: - _sunrise_sunset_face_update(settings, state); + _sunrise_sunset_face_update(state); break; case EVENT_LOW_ENERGY_UPDATE: case EVENT_TICK: @@ -343,7 +341,7 @@ bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *setti 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; - _sunrise_sunset_face_update(settings, state); + _sunrise_sunset_face_update(state); } } else { _sunrise_sunset_face_update_settings_display(event, state); @@ -364,7 +362,7 @@ bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *setti } if (state->page == 0) { movement_request_tick_frequency(1); - _sunrise_sunset_face_update(settings, state); + _sunrise_sunset_face_update(state); } break; case EVENT_LIGHT_LONG_PRESS: @@ -374,7 +372,7 @@ bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *setti case EVENT_LIGHT_BUTTON_UP: if (state->page == 0 && _location_count > 1) { state->longLatToUse = (state->longLatToUse + 1) % _location_count; - _sunrise_sunset_face_update(settings, state); + _sunrise_sunset_face_update(state); } break; case EVENT_ALARM_BUTTON_UP: @@ -383,14 +381,14 @@ bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *setti _sunrise_sunset_face_update_settings_display(event, context); } else { state->rise_index = (state->rise_index + 1) % 2; - _sunrise_sunset_face_update(settings, state); + _sunrise_sunset_face_update(state); } break; case EVENT_ALARM_LONG_PRESS: if (state->page == 0) { if (state->longLatToUse != 0) { state->longLatToUse = 0; - _sunrise_sunset_face_update(settings, state); + _sunrise_sunset_face_update(state); break; } state->page++; @@ -403,7 +401,7 @@ bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *setti state->active_digit = 0; state->page = 0; _sunrise_sunset_face_update_location_register(state); - _sunrise_sunset_face_update(settings, state); + _sunrise_sunset_face_update(state); } break; case EVENT_TIMEOUT: @@ -415,18 +413,17 @@ bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *setti state->page = 0; state->rise_index = 0; movement_request_tick_frequency(1); - _sunrise_sunset_face_update(settings, state); + _sunrise_sunset_face_update(state); } break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void sunrise_sunset_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void sunrise_sunset_face_resign(void *context) { sunrise_sunset_state_t *state = (sunrise_sunset_state_t *)context; state->page = 0; state->active_digit = 0; diff --git a/movement/watch_faces/complication/sunrise_sunset_face.h b/movement/watch_faces/complication/sunrise_sunset_face.h index df5fda5c..133eed02 100644 --- a/movement/watch_faces/complication/sunrise_sunset_face.h +++ b/movement/watch_faces/complication/sunrise_sunset_face.h @@ -58,10 +58,10 @@ typedef struct { uint8_t longLatToUse; } sunrise_sunset_state_t; -void sunrise_sunset_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void sunrise_sunset_face_activate(movement_settings_t *settings, void *context); -bool sunrise_sunset_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void sunrise_sunset_face_resign(movement_settings_t *settings, void *context); +void sunrise_sunset_face_setup(uint8_t watch_face_index, void ** context_ptr); +void sunrise_sunset_face_activate(void *context); +bool sunrise_sunset_face_loop(movement_event_t event, void *context); +void sunrise_sunset_face_resign(void *context); #define sunrise_sunset_face ((const watch_face_t){ \ sunrise_sunset_face_setup, \ diff --git a/movement/watch_faces/complication/tachymeter_face.c b/movement/watch_faces/complication/tachymeter_face.c index 056ac845..84748b89 100644 --- a/movement/watch_faces/complication/tachymeter_face.c +++ b/movement/watch_faces/complication/tachymeter_face.c @@ -38,8 +38,7 @@ static uint32_t _distance_from_struct(distance_digits_t dist_digits) { return retval; } -void tachymeter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void)settings; +void tachymeter_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void)watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(tachymeter_state_t)); @@ -51,8 +50,7 @@ void tachymeter_face_setup(movement_settings_t *settings, uint8_t watch_face_ind } } -void tachymeter_face_activate(movement_settings_t *settings, void *context) { - (void)settings; +void tachymeter_face_activate(void *context) { (void)context; movement_request_tick_frequency(4); // 4Hz } @@ -91,8 +89,7 @@ static void _tachymeter_face_totals_lcd(tachymeter_state_t *state, bool show_tim } } -bool tachymeter_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void)settings; +bool tachymeter_face_loop(movement_event_t event, void *context) { tachymeter_state_t *state = (tachymeter_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: @@ -254,7 +251,7 @@ bool tachymeter_face_loop(movement_event_t event, movement_settings_t *settings, // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } // return true if the watch can enter standby mode. If you are PWM'ing an LED or buzzing the buzzer here, @@ -262,8 +259,7 @@ bool tachymeter_face_loop(movement_event_t event, movement_settings_t *settings, return true; } -void tachymeter_face_resign(movement_settings_t *settings, void *context) { - (void)settings; +void tachymeter_face_resign(void *context) { (void)context; // handle any cleanup before your watch face goes off-screen. } diff --git a/movement/watch_faces/complication/tachymeter_face.h b/movement/watch_faces/complication/tachymeter_face.h index 3b23525f..98f96e25 100644 --- a/movement/watch_faces/complication/tachymeter_face.h +++ b/movement/watch_faces/complication/tachymeter_face.h @@ -92,10 +92,10 @@ typedef struct { uint32_t total_speed; // 3600 * 100 * distance / total_time } tachymeter_state_t; -void tachymeter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void tachymeter_face_activate(movement_settings_t *settings, void *context); -bool tachymeter_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void tachymeter_face_resign(movement_settings_t *settings, void *context); +void tachymeter_face_setup(uint8_t watch_face_index, void ** context_ptr); +void tachymeter_face_activate(void *context); +bool tachymeter_face_loop(movement_event_t event, void *context); +void tachymeter_face_resign(void *context); #define tachymeter_face ((const watch_face_t){ \ tachymeter_face_setup, \ diff --git a/movement/watch_faces/complication/tally_face.c b/movement/watch_faces/complication/tally_face.c index 07b43023..75d59c86 100644 --- a/movement/watch_faces/complication/tally_face.c +++ b/movement/watch_faces/complication/tally_face.c @@ -50,8 +50,7 @@ static const int16_t _tally_default[] = { #define TALLY_FACE_PRESETS_SIZE() (sizeof(_tally_default) / sizeof(int16_t)) -void tally_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void tally_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(tally_state_t)); @@ -63,8 +62,7 @@ void tally_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v } } -void tally_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void tally_face_activate(void *context) { (void) context; _quick_ticks_running = false; } @@ -110,7 +108,7 @@ static bool tally_face_should_move_back(tally_state_t *state) { return state->tally_idx == _tally_default[state->tally_default_idx]; } -bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool tally_face_loop(movement_event_t event, void *context) { tally_state_t *state = (tally_state_t *)context; static bool using_led = false; @@ -188,7 +186,7 @@ bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void // ignore timeout break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } @@ -209,7 +207,6 @@ void print_tally(tally_state_t *state, bool sound_on) { watch_display_string(buf, 0); } -void tally_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void tally_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/tally_face.h b/movement/watch_faces/complication/tally_face.h index 80623f49..7b18a33b 100644 --- a/movement/watch_faces/complication/tally_face.h +++ b/movement/watch_faces/complication/tally_face.h @@ -58,10 +58,10 @@ typedef struct { //#define TALLY_FACE_PRESETS_YUGIOH -void tally_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void tally_face_activate(movement_settings_t *settings, void *context); -bool tally_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void tally_face_resign(movement_settings_t *settings, void *context); +void tally_face_setup(uint8_t watch_face_index, void ** context_ptr); +void tally_face_activate(void *context); +bool tally_face_loop(movement_event_t event, void *context); +void tally_face_resign(void *context); void print_tally(tally_state_t *state, bool sound_on); diff --git a/movement/watch_faces/complication/tarot_face.c b/movement/watch_faces/complication/tarot_face.c index 44b01de4..ae819412 100644 --- a/movement/watch_faces/complication/tarot_face.c +++ b/movement/watch_faces/complication/tarot_face.c @@ -208,8 +208,7 @@ static void display_animation(tarot_state_t *state) { // --------------------------- // Standard watch face methods // --------------------------- -void tarot_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void tarot_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(tarot_state_t)); @@ -221,8 +220,7 @@ void tarot_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v #endif } -void tarot_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void tarot_face_activate(void *context) { tarot_state_t *state = (tarot_state_t *)context; watch_display_string("TA", 0); @@ -231,8 +229,7 @@ void tarot_face_activate(movement_settings_t *settings, void *context) { state->major_arcana_only = true; } -bool tarot_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool tarot_face_loop(movement_event_t event, void *context) { tarot_state_t *state = (tarot_state_t *)context; if (state->is_picking && event.event_type != EVENT_TICK) { @@ -288,14 +285,13 @@ bool tarot_face_loop(movement_event_t event, movement_settings_t *settings, void // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void tarot_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void tarot_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/tarot_face.h b/movement/watch_faces/complication/tarot_face.h index b48a7ae9..8c83d518 100644 --- a/movement/watch_faces/complication/tarot_face.h +++ b/movement/watch_faces/complication/tarot_face.h @@ -73,10 +73,10 @@ typedef struct { bool is_picking; } tarot_state_t; -void tarot_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void tarot_face_activate(movement_settings_t *settings, void *context); -bool tarot_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void tarot_face_resign(movement_settings_t *settings, void *context); +void tarot_face_setup(uint8_t watch_face_index, void ** context_ptr); +void tarot_face_activate(void *context); +bool tarot_face_loop(movement_event_t event, void *context); +void tarot_face_resign(void *context); #define tarot_face ((const watch_face_t){ \ tarot_face_setup, \ diff --git a/movement/watch_faces/complication/tempchart_face.c b/movement/watch_faces/complication/tempchart_face.c index 6c6d1bd9..6825c78e 100644 --- a/movement/watch_faces/complication/tempchart_face.c +++ b/movement/watch_faces/complication/tempchart_face.c @@ -40,10 +40,9 @@ static void tempchart_save(void) { filesystem_write_file("tempchart.ini", (char*)&tempchart_state, sizeof(tempchart_state)); } -void tempchart_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void tempchart_face_setup(uint8_t watch_face_index, void ** context_ptr) { // These next two lines just silence the compiler warnings associated with unused parameters. // We have no use for the settings or the watch_face_index, so we make that explicit here. - (void) settings; (void) context_ptr; (void) watch_face_index; // At boot, context_ptr will be NULL indicating that we don't have anyplace to store our context. @@ -58,9 +57,8 @@ void tempchart_face_setup(movement_settings_t *settings, uint8_t watch_face_inde } -void tempchart_face_activate(movement_settings_t *settings, void *context) { +void tempchart_face_activate(void *context) { // same as above: silence the warning, we don't need to check the settings. - (void) settings; (void) context; } @@ -74,8 +72,7 @@ static void display(void) { watch_display_string(buf, 0); } -bool tempchart_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool tempchart_face_loop(movement_event_t event, void *context) { (void) context; switch (event.event_type) { @@ -122,23 +119,21 @@ bool tempchart_face_loop(movement_event_t event, movement_settings_t *settings, break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void tempchart_face_resign(movement_settings_t *settings, void *context) { +void tempchart_face_resign(void *context) { // our watch face, like most watch faces, has nothing special to do when resigning. // watch faces that enable a peripheral or interact with a sensor may want to turn it off here. - (void) settings; (void) context; } //background freq correction -bool tempchart_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool tempchart_face_wants_background_task(void *context) { (void) context; watch_date_time date_time = watch_rtc_get_date_time(); diff --git a/movement/watch_faces/complication/tempchart_face.h b/movement/watch_faces/complication/tempchart_face.h index 3c9a389f..db89d204 100644 --- a/movement/watch_faces/complication/tempchart_face.h +++ b/movement/watch_faces/complication/tempchart_face.h @@ -40,11 +40,11 @@ #include "movement.h" -void tempchart_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void tempchart_face_activate(movement_settings_t *settings, void *context); -bool tempchart_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void tempchart_face_resign(movement_settings_t *settings, void *context); -bool tempchart_face_wants_background_task(movement_settings_t *settings, void *context); +void tempchart_face_setup(uint8_t watch_face_index, void ** context_ptr); +void tempchart_face_activate(void *context); +bool tempchart_face_loop(movement_event_t event, void *context); +void tempchart_face_resign(void *context); +bool tempchart_face_wants_background_task(void *context); #define tempchart_face ((const watch_face_t){ \ diff --git a/movement/watch_faces/complication/time_left_face.c b/movement/watch_faces/complication/time_left_face.c index 99b0f87f..9e8caf87 100644 --- a/movement/watch_faces/complication/time_left_face.c +++ b/movement/watch_faces/complication/time_left_face.c @@ -205,8 +205,7 @@ static void _abort_quick_ticks() { } } -void time_left_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void time_left_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(time_left_state_t)); @@ -230,8 +229,7 @@ void time_left_face_setup(movement_settings_t *settings, uint8_t watch_face_inde } } -void time_left_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void time_left_face_activate(void *context) { time_left_state_t *state = (time_left_state_t *)context; // stash the current year, useful in birthday setting mode @@ -244,8 +242,7 @@ void time_left_face_activate(movement_settings_t *settings, void *context) { state->birth_date_when_activated.reg = state->birth_date.reg; } -bool time_left_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool time_left_face_loop(movement_event_t event, void *context) { time_left_state_t *state = (time_left_state_t *)context; switch (event.event_type) { @@ -326,15 +323,14 @@ bool time_left_face_loop(movement_event_t event, movement_settings_t *settings, movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void time_left_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void time_left_face_resign(void *context) { time_left_state_t *state = (time_left_state_t *)context; if (state->current_page >= TIME_LEFT_FACE_SETTINGS_STATE) _resume_setting(state); diff --git a/movement/watch_faces/complication/time_left_face.h b/movement/watch_faces/complication/time_left_face.h index 805fd198..8f20ca0a 100644 --- a/movement/watch_faces/complication/time_left_face.h +++ b/movement/watch_faces/complication/time_left_face.h @@ -75,10 +75,10 @@ typedef struct { movement_birthdate_t target_date; } time_left_state_t; -void time_left_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void time_left_face_activate(movement_settings_t *settings, void *context); -bool time_left_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void time_left_face_resign(movement_settings_t *settings, void *context); +void time_left_face_setup(uint8_t watch_face_index, void ** context_ptr); +void time_left_face_activate(void *context); +bool time_left_face_loop(movement_event_t event, void *context); +void time_left_face_resign(void *context); #define time_left_face ((const watch_face_t){ \ time_left_face_setup, \ diff --git a/movement/watch_faces/complication/timer_face.c b/movement/watch_faces/complication/timer_face.c index 50b93ec9..b993a615 100644 --- a/movement/watch_faces/complication/timer_face.c +++ b/movement/watch_faces/complication/timer_face.c @@ -36,10 +36,6 @@ static const int8_t _sound_seq_start[] = {BUZZER_NOTE_C8, 2, 0}; static uint8_t _beeps_to_play; // temporary counter for ring signals playing -static inline int32_t _get_tz_offset(movement_settings_t *settings) { - return movement_get_current_timezone_offset(); -} - static void _signal_callback() { if (_beeps_to_play) { _beeps_to_play--; @@ -47,10 +43,10 @@ static void _signal_callback() { } } -static void _start(timer_state_t *state, movement_settings_t *settings, bool with_beep) { +static void _start(timer_state_t *state, bool with_beep) { if (state->timers[state->current_timer].value == 0) return; watch_date_time now = watch_rtc_get_date_time(); - state->now_ts = watch_utility_date_time_to_unix_time(now, _get_tz_offset(settings)); + state->now_ts = watch_utility_date_time_to_unix_time(now, movement_get_current_timezone_offset()); if (state->mode == pausing) state->target_ts = state->now_ts + state->paused_left; else @@ -58,7 +54,7 @@ static void _start(timer_state_t *state, movement_settings_t *settings, bool wit state->timers[state->current_timer].unit.hours, state->timers[state->current_timer].unit.minutes, state->timers[state->current_timer].unit.seconds); - watch_date_time target_dt = watch_utility_date_time_from_unix_time(state->target_ts, _get_tz_offset(settings)); + watch_date_time target_dt = watch_utility_date_time_from_unix_time(state->target_ts, movement_get_current_timezone_offset()); state->mode = running; movement_schedule_background_task_for_face(state->watch_face_index, target_dt); watch_set_indicator(WATCH_INDICATOR_BELL); @@ -189,8 +185,7 @@ static inline bool _check_for_signal() { return false; } -void timer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void timer_face_setup(uint8_t watch_face_index, void ** context_ptr) { if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(timer_state_t)); @@ -203,14 +198,13 @@ void timer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v } } -void timer_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void timer_face_activate(void *context) { timer_state_t *state = (timer_state_t *)context; watch_display_string("TR", 0); watch_set_colon(); if(state->mode == running) { watch_date_time now = watch_rtc_get_date_time(); - state->now_ts = watch_utility_date_time_to_unix_time(now, _get_tz_offset(settings)); + state->now_ts = watch_utility_date_time_to_unix_time(now, movement_get_current_timezone_offset()); watch_set_indicator(WATCH_INDICATOR_BELL); } else { state->pausing_seconds = 1; @@ -218,8 +212,7 @@ void timer_face_activate(movement_settings_t *settings, void *context) { } } -bool timer_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool timer_face_loop(movement_event_t event, void *context) { timer_state_t *state = (timer_state_t *)context; uint8_t subsecond = event.subsecond; @@ -272,14 +265,14 @@ bool timer_face_loop(movement_event_t event, movement_settings_t *settings, void movement_cancel_background_task(); break; case pausing: - _start(state, settings, false); + _start(statemovement_get_current_timezone_offset(), false); break; case waiting: { uint8_t last_timer = state->current_timer; state->current_timer = (state->current_timer + 1) % TIMER_SLOTS; _set_next_valid_timer(state); // start the time immediately if there is only one valid timer slot - if (last_timer == state->current_timer) _start(state, settings, true); + if (last_timer == state->current_timer) _start(statemovement_get_current_timezone_offset(), true); break; } case setting: @@ -306,7 +299,7 @@ bool timer_face_loop(movement_event_t event, movement_settings_t *settings, void _beeps_to_play = 4; watch_buzzer_play_sequence((int8_t *)_sound_seq_beep, _signal_callback); _reset(state); - if (state->timers[state->current_timer].unit.repeat) _start(state, settings, false); + if (state->timers[state->current_timer].unit.repeat) _start(statemovement_get_current_timezone_offset(), false); break; case EVENT_ALARM_LONG_PRESS: switch(state->mode) { @@ -326,7 +319,7 @@ bool timer_face_loop(movement_event_t event, movement_settings_t *settings, void } break; case waiting: - _start(state, settings, true); + _start(statemovement_get_current_timezone_offset(), true); break; case pausing: case running: @@ -347,15 +340,14 @@ bool timer_face_loop(movement_event_t event, movement_settings_t *settings, void movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void timer_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void timer_face_resign(void *context) { timer_state_t *state = (timer_state_t *)context; if (state->mode == setting) { state->settings_state = 0; diff --git a/movement/watch_faces/complication/timer_face.h b/movement/watch_faces/complication/timer_face.h index 3302f125..b59c9589 100644 --- a/movement/watch_faces/complication/timer_face.h +++ b/movement/watch_faces/complication/timer_face.h @@ -86,10 +86,10 @@ typedef struct { bool quick_cycle : 1; } timer_state_t; -void timer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void timer_face_activate(movement_settings_t *settings, void *context); -bool timer_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void timer_face_resign(movement_settings_t *settings, void *context); +void timer_face_setup(uint8_t watch_face_index, void ** context_ptr); +void timer_face_activate(void *context); +bool timer_face_loop(movement_event_t event, void *context); +void timer_face_resign(void *context); #define timer_face ((const watch_face_t){ \ timer_face_setup, \ diff --git a/movement/watch_faces/complication/tomato_face.c b/movement/watch_faces/complication/tomato_face.c index b4b7ae37..6e9f6bbd 100644 --- a/movement/watch_faces/complication/tomato_face.c +++ b/movement/watch_faces/complication/tomato_face.c @@ -30,10 +30,6 @@ static uint8_t focus_min = 25; static uint8_t break_min = 5; -static inline int32_t get_tz_offset(movement_settings_t *settings) { - return movement_get_current_timezone_offset(); -} - static uint8_t get_length(tomato_state_t *state) { uint8_t length; if (state->kind == tomato_focus) { @@ -45,14 +41,14 @@ static uint8_t get_length(tomato_state_t *state) { return length; } -static void tomato_start(tomato_state_t *state, movement_settings_t *settings) { +static void tomato_start(tomato_state_t *state) { watch_date_time now = watch_rtc_get_date_time(); int8_t length = (int8_t) get_length(state); state->mode = tomato_run; - state->now_ts = watch_utility_date_time_to_unix_time(now, get_tz_offset(settings)); + state->now_ts = watch_utility_date_time_to_unix_time(now, movement_get_current_timezone_offset()); state->target_ts = watch_utility_offset_timestamp(state->now_ts, 0, length, 0); - watch_date_time target_dt = watch_utility_date_time_from_unix_time(state->target_ts, get_tz_offset(settings)); + watch_date_time target_dt = watch_utility_date_time_from_unix_time(state->target_ts, movement_get_current_timezone_offset()); movement_schedule_background_task(target_dt); watch_set_indicator(WATCH_INDICATOR_BELL); } @@ -107,8 +103,7 @@ static void tomato_ring(tomato_state_t *state) { } } -void tomato_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void tomato_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -122,18 +117,18 @@ void tomato_face_setup(movement_settings_t *settings, uint8_t watch_face_index, } } -void tomato_face_activate(movement_settings_t *settings, void *context) { +void tomato_face_activate(void *context) { tomato_state_t *state = (tomato_state_t *)context; if (state->mode == tomato_run) { watch_date_time now = watch_rtc_get_date_time(); - state->now_ts = watch_utility_date_time_to_unix_time(now, get_tz_offset(settings)); + state->now_ts = watch_utility_date_time_to_unix_time(now, movement_get_current_timezone_offset()); watch_set_indicator(WATCH_INDICATOR_BELL); } watch_set_colon(); state->visible = true; } -bool tomato_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool tomato_face_loop(movement_event_t event, void *context) { tomato_state_t *state = (tomato_state_t *)context; switch (event.event_type) { @@ -163,7 +158,7 @@ bool tomato_face_loop(movement_event_t event, movement_settings_t *settings, voi tomato_reset(state); break; case tomato_ready: - tomato_start(state, settings); + tomato_start(state); break; } tomato_draw(state); @@ -180,17 +175,16 @@ bool tomato_face_loop(movement_event_t event, movement_settings_t *settings, voi movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void tomato_face_resign(movement_settings_t *settings, void *context) { +void tomato_face_resign(void *context) { tomato_state_t *state = (tomato_state_t *)context; state->visible = false; - (void) settings; (void) context; } diff --git a/movement/watch_faces/complication/tomato_face.h b/movement/watch_faces/complication/tomato_face.h index 25f7db0e..e06a7c8c 100644 --- a/movement/watch_faces/complication/tomato_face.h +++ b/movement/watch_faces/complication/tomato_face.h @@ -67,10 +67,10 @@ typedef struct { bool visible; } tomato_state_t; -void tomato_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void tomato_face_activate(movement_settings_t *settings, void *context); -bool tomato_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void tomato_face_resign(movement_settings_t *settings, void *context); +void tomato_face_setup(uint8_t watch_face_index, void ** context_ptr); +void tomato_face_activate(void *context); +bool tomato_face_loop(movement_event_t event, void *context); +void tomato_face_resign(void *context); #define tomato_face ((const watch_face_t){ \ tomato_face_setup, \ diff --git a/movement/watch_faces/complication/toss_up_face.c b/movement/watch_faces/complication/toss_up_face.c index cf6ca680..28b99c99 100644 --- a/movement/watch_faces/complication/toss_up_face.c +++ b/movement/watch_faces/complication/toss_up_face.c @@ -44,9 +44,8 @@ static void _coin_animation(toss_up_state_t *state); // PUBLIC FUNCTIONS /////////////////////////////////////////////////////////// -void toss_up_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void toss_up_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; - (void) settings; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(toss_up_state_t)); memset(*context_ptr, 0, sizeof(toss_up_state_t)); @@ -63,12 +62,11 @@ void toss_up_face_setup(movement_settings_t *settings, uint8_t watch_face_index, } } -void toss_up_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void toss_up_face_activate(void *context) { (void) context; } -bool toss_up_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool toss_up_face_loop(movement_event_t event, void *context) { toss_up_state_t *state = (toss_up_state_t *)context; uint8_t i = 0; switch (event.event_type) { @@ -170,14 +168,13 @@ bool toss_up_face_loop(movement_event_t event, movement_settings_t *settings, vo _toss_up_face_display(state); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void toss_up_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void toss_up_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/toss_up_face.h b/movement/watch_faces/complication/toss_up_face.h index cff34096..d6a77d7f 100644 --- a/movement/watch_faces/complication/toss_up_face.h +++ b/movement/watch_faces/complication/toss_up_face.h @@ -95,10 +95,10 @@ typedef struct { uint32_t get_true_entropy(void); uint8_t divine_bit(void); uint8_t roll_dice(uint8_t sides); -void toss_up_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void toss_up_face_activate(movement_settings_t *settings, void *context); -bool toss_up_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void toss_up_face_resign(movement_settings_t *settings, void *context); +void toss_up_face_setup(uint8_t watch_face_index, void ** context_ptr); +void toss_up_face_activate(void *context); +bool toss_up_face_loop(movement_event_t event, void *context); +void toss_up_face_resign(void *context); #define toss_up_face ((const watch_face_t){ \ toss_up_face_setup, \ diff --git a/movement/watch_faces/complication/totp_face.c b/movement/watch_faces/complication/totp_face.c index 7fb45e56..c159f596 100644 --- a/movement/watch_faces/complication/totp_face.c +++ b/movement/watch_faces/complication/totp_face.c @@ -157,12 +157,11 @@ static void totp_generate_and_display(totp_state_t *totp_state) { totp_display(totp_state); } -static inline uint32_t totp_compute_base_timestamp(movement_settings_t *settings) { +static inline uint32_t totp_compute_base_timestamp() { return watch_utility_date_time_to_unix_time(watch_rtc_get_date_time(), movement_get_current_timezone_offset()); } -void totp_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void totp_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; totp_validate_key_lengths(); @@ -174,12 +173,11 @@ void totp_face_setup(movement_settings_t *settings, uint8_t watch_face_index, vo } } -void totp_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void totp_face_activate(void *context) { totp_state_t *totp = (totp_state_t *) context; - totp->timestamp = totp_compute_base_timestamp(settings); + totp->timestamp = totp_compute_base_timestamp(); totp->steps = 0; totp->current_code = 0; totp->current_index = 0; @@ -189,8 +187,7 @@ void totp_face_activate(movement_settings_t *settings, void *context) { totp_generate_and_display(totp); } -bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool totp_face_loop(movement_event_t event, void *context) { totp_state_t *totp_state = (totp_state_t *) context; @@ -234,14 +231,13 @@ bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void movement_illuminate_led(); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void totp_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void totp_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/totp_face.h b/movement/watch_faces/complication/totp_face.h index acdcc8b1..0dc1b8e6 100644 --- a/movement/watch_faces/complication/totp_face.h +++ b/movement/watch_faces/complication/totp_face.h @@ -78,10 +78,10 @@ typedef struct { size_t current_decoded_key_length; } totp_state_t; -void totp_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void totp_face_activate(movement_settings_t *settings, void *context); -bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void totp_face_resign(movement_settings_t *settings, void *context); +void totp_face_setup(uint8_t watch_face_index, void ** context_ptr); +void totp_face_activate(void *context); +bool totp_face_loop(movement_event_t event, void *context); +void totp_face_resign(void *context); #define totp_face ((const watch_face_t){ \ totp_face_setup, \ diff --git a/movement/watch_faces/complication/totp_face_lfs.c b/movement/watch_faces/complication/totp_face_lfs.c index 8823cbc9..439aca3f 100644 --- a/movement/watch_faces/complication/totp_face_lfs.c +++ b/movement/watch_faces/complication/totp_face_lfs.c @@ -189,8 +189,7 @@ static void totp_face_lfs_read_file(char *filename) { } } -void totp_face_lfs_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void totp_face_lfs_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(totp_lfs_state_t)); @@ -241,8 +240,7 @@ static void totp_face_set_record(totp_lfs_state_t *totp_state, int i) { totp_state->steps = totp_state->timestamp / record->period; } -void totp_face_lfs_activate(movement_settings_t *settings, void *context) { - (void) settings; +void totp_face_lfs_activate(void *context) { memset(context, 0, sizeof(totp_lfs_state_t)); totp_lfs_state_t *totp_state = (totp_lfs_state_t *)context; @@ -279,8 +277,7 @@ static void totp_face_display(totp_lfs_state_t *totp_state) { watch_display_string(buf, 0); } -bool totp_face_lfs_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool totp_face_lfs_loop(movement_event_t event, void *context) { totp_lfs_state_t *totp_state = (totp_lfs_state_t *)context; @@ -311,14 +308,13 @@ bool totp_face_lfs_loop(movement_event_t event, movement_settings_t *settings, v movement_illuminate_led(); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void totp_face_lfs_resign(movement_settings_t *settings, void *context) { - (void) settings; +void totp_face_lfs_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/totp_face_lfs.h b/movement/watch_faces/complication/totp_face_lfs.h index 67dcd0b8..16276a2e 100644 --- a/movement/watch_faces/complication/totp_face_lfs.h +++ b/movement/watch_faces/complication/totp_face_lfs.h @@ -61,10 +61,10 @@ typedef struct { uint8_t current_index; } totp_lfs_state_t; -void totp_face_lfs_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void totp_face_lfs_activate(movement_settings_t *settings, void *context); -bool totp_face_lfs_loop(movement_event_t event, movement_settings_t *settings, void *context); -void totp_face_lfs_resign(movement_settings_t *settings, void *context); +void totp_face_lfs_setup(uint8_t watch_face_index, void ** context_ptr); +void totp_face_lfs_activate(void *context); +bool totp_face_lfs_loop(movement_event_t event, void *context); +void totp_face_lfs_resign(void *context); #define totp_face_lfs ((const watch_face_t){ \ totp_face_lfs_setup, \ diff --git a/movement/watch_faces/complication/tuning_tones_face.c b/movement/watch_faces/complication/tuning_tones_face.c index 8898397a..686de688 100644 --- a/movement/watch_faces/complication/tuning_tones_face.c +++ b/movement/watch_faces/complication/tuning_tones_face.c @@ -64,8 +64,7 @@ static void draw(tuning_tones_state_t *state) watch_display_string(notes[state->note_ind].name, 8); } -void tuning_tones_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void tuning_tones_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { tuning_tones_state_t *state = malloc(sizeof *state); @@ -75,8 +74,7 @@ void tuning_tones_face_setup(movement_settings_t *settings, uint8_t watch_face_i } } -void tuning_tones_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void tuning_tones_face_activate(void *context) { (void) context; } @@ -89,7 +87,7 @@ static void update_buzzer(const tuning_tones_state_t *state) } } -bool tuning_tones_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool tuning_tones_face_loop(movement_event_t event, void *context) { tuning_tones_state_t *state = (tuning_tones_state_t *)context; switch (event.event_type) { @@ -123,14 +121,13 @@ bool tuning_tones_face_loop(movement_event_t event, movement_settings_t *setting case EVENT_LOW_ENERGY_UPDATE: break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return !state->playing; } -void tuning_tones_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void tuning_tones_face_resign(void *context) { tuning_tones_state_t *state = (tuning_tones_state_t *)context; if (state->playing) { diff --git a/movement/watch_faces/complication/tuning_tones_face.h b/movement/watch_faces/complication/tuning_tones_face.h index d6e3495e..08672a54 100644 --- a/movement/watch_faces/complication/tuning_tones_face.h +++ b/movement/watch_faces/complication/tuning_tones_face.h @@ -40,10 +40,10 @@ typedef struct { size_t note_ind; } tuning_tones_state_t; -void tuning_tones_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void tuning_tones_face_activate(movement_settings_t *settings, void *context); -bool tuning_tones_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void tuning_tones_face_resign(movement_settings_t *settings, void *context); +void tuning_tones_face_setup(uint8_t watch_face_index, void ** context_ptr); +void tuning_tones_face_activate(void *context); +bool tuning_tones_face_loop(movement_event_t event, void *context); +void tuning_tones_face_resign(void *context); #define tuning_tones_face ((const watch_face_t){ \ tuning_tones_face_setup, \ diff --git a/movement/watch_faces/complication/wake_face.c b/movement/watch_faces/complication/wake_face.c index 79262563..1829aee4 100644 --- a/movement/watch_faces/complication/wake_face.c +++ b/movement/watch_faces/complication/wake_face.c @@ -33,8 +33,7 @@ // static -void _wake_face_update_display(movement_settings_t *settings, wake_face_state_t *state) { - (void) settings; +void _wake_face_update_display(wake_face_state_t *state) { uint8_t hour = state->hour; watch_clear_display(); @@ -60,8 +59,7 @@ void _wake_face_update_display(movement_settings_t *settings, wake_face_state_t // Exported // -void wake_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) { - (void) settings; +void wake_face_setup(uint8_t watch_face_index, void **context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -75,17 +73,14 @@ void wake_face_setup(movement_settings_t *settings, uint8_t watch_face_index, vo } } -void wake_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void wake_face_activate(void *context) { (void) context; } -void wake_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void wake_face_resign(void *context) { (void) context; } -bool wake_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool wake_face_wants_background_task(void *context) { wake_face_state_t *state = (wake_face_state_t *)context; bool rc = false; @@ -103,30 +98,29 @@ bool wake_face_wants_background_task(movement_settings_t *settings, void *contex return rc; } -bool wake_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool wake_face_loop(movement_event_t event, void *context) { wake_face_state_t *state = (wake_face_state_t *)context; switch (event.event_type) { case EVENT_ACTIVATE: case EVENT_TICK: - _wake_face_update_display(settings, state); + _wake_face_update_display(state); break; case EVENT_LIGHT_BUTTON_UP: state->hour = (state->hour + 1) % 24; - _wake_face_update_display(settings, state); + _wake_face_update_display(state); break; case EVENT_LIGHT_LONG_PRESS: state->hour = (state->hour + 6) % 24; - _wake_face_update_display(settings, state); + _wake_face_update_display(state); break; case EVENT_ALARM_BUTTON_UP: state->minute = (state->minute + 10) % 60; - _wake_face_update_display(settings, state); + _wake_face_update_display(state); break; case EVENT_ALARM_LONG_PRESS: state->mode ^= 1; - _wake_face_update_display(settings, state); + _wake_face_update_display(state); break; case EVENT_BACKGROUND_TASK: movement_play_alarm(); @@ -141,7 +135,7 @@ bool wake_face_loop(movement_event_t event, movement_settings_t *settings, void // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } diff --git a/movement/watch_faces/complication/wake_face.h b/movement/watch_faces/complication/wake_face.h index b4a25a9c..72606afd 100644 --- a/movement/watch_faces/complication/wake_face.h +++ b/movement/watch_faces/complication/wake_face.h @@ -48,11 +48,11 @@ typedef struct { uint32_t mode : 1; } wake_face_state_t; -void wake_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr); -void wake_face_activate(movement_settings_t *settings, void *context); -bool wake_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void wake_face_resign(movement_settings_t *settings, void *context); -bool wake_face_wants_background_task(movement_settings_t *settings, void *context); +void wake_face_setup(uint8_t watch_face_index, void **context_ptr); +void wake_face_activate(void *context); +bool wake_face_loop(movement_event_t event, void *context); +void wake_face_resign(void *context); +bool wake_face_wants_background_task(void *context); #define wake_face ((const watch_face_t){ \ wake_face_setup, \ diff --git a/movement/watch_faces/complication/wareki_face.c b/movement/watch_faces/complication/wareki_face.c index 154a5682..ce9777b2 100644 --- a/movement/watch_faces/complication/wareki_face.c +++ b/movement/watch_faces/complication/wareki_face.c @@ -10,11 +10,10 @@ static bool _alarm_button_press; static bool _light_button_press; -void wareki_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void wareki_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; //printf("wareki_setup() \n"); - (void) settings; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(wareki_state_t)); memset(*context_ptr, 0, sizeof(wareki_state_t)); @@ -53,11 +52,10 @@ static void draw_year_and_wareki(wareki_state_t *state) { } -void wareki_activate(movement_settings_t *settings, void *context) { +void wareki_activate(void *context) { //printf("wareki_activate() \n"); - (void) settings; wareki_state_t *state = (wareki_state_t *)context; if (watch_tick_animation_is_running()) watch_stop_tick_animation(); @@ -101,7 +99,7 @@ void subYear(wareki_state_t* state,int count){ } -bool wareki_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool wareki_loop(movement_event_t event, void *context) { wareki_state_t *state = (wareki_state_t *)context; state->real_year = watch_rtc_get_date_time().unit.year + WATCH_RTC_REFERENCE_YEAR; @@ -208,14 +206,13 @@ bool wareki_loop(movement_event_t event, movement_settings_t *settings, void *co // * EVENT_MODE_BUTTON_UP moves to the next watch face in the list // * EVENT_MODE_LONG_PRESS returns to the first watch face (or skips to the secondary watch face, if configured) // You can override any of these behaviors by adding a case for these events to this switch statement. - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void wareki_resign(movement_settings_t *settings, void *context) { - (void) settings; +void wareki_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/wareki_face.h b/movement/watch_faces/complication/wareki_face.h index a07f3f68..4dffc46d 100644 --- a/movement/watch_faces/complication/wareki_face.h +++ b/movement/watch_faces/complication/wareki_face.h @@ -15,10 +15,10 @@ typedef struct { } wareki_state_t; -void wareki_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void wareki_activate(movement_settings_t *settings, void *context); -bool wareki_loop(movement_event_t event, movement_settings_t *settings, void *context); -void wareki_resign(movement_settings_t *settings, void *context); +void wareki_setup(uint8_t watch_face_index, void ** context_ptr); +void wareki_activate(void *context); +bool wareki_loop(movement_event_t event, void *context); +void wareki_resign(void *context); void addYear(wareki_state_t* state,int count); void subYear(wareki_state_t* state,int count); diff --git a/movement/watch_faces/complication/wordle_face.c b/movement/watch_faces/complication/wordle_face.c index 8381cec4..cae36eb4 100644 --- a/movement/watch_faces/complication/wordle_face.c +++ b/movement/watch_faces/complication/wordle_face.c @@ -476,8 +476,7 @@ static void insert_random_guess(wordle_state_t *state) { } #endif -void wordle_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void wordle_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(wordle_state_t)); @@ -490,8 +489,7 @@ void wordle_face_setup(movement_settings_t *settings, uint8_t watch_face_index, // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void wordle_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void wordle_face_activate(void *context) { wordle_state_t *state = (wordle_state_t *)context; #if WORDLE_USE_DAILY_STREAK != 0 uint32_t now = get_day_unix_time(); @@ -511,7 +509,7 @@ void wordle_face_activate(movement_settings_t *settings, void *context) { display_title(state); } -bool wordle_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool wordle_face_loop(movement_event_t event, void *context) { wordle_state_t *state = (wordle_state_t *)context; switch (event.event_type) { @@ -590,13 +588,12 @@ bool wordle_face_loop(movement_event_t event, movement_settings_t *settings, voi display_title(state); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void wordle_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void wordle_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/complication/wordle_face.h b/movement/watch_faces/complication/wordle_face.h index f390e736..5cc2f09a 100644 --- a/movement/watch_faces/complication/wordle_face.h +++ b/movement/watch_faces/complication/wordle_face.h @@ -132,10 +132,10 @@ typedef struct { uint32_t day_last_game_started; } wordle_state_t; -void wordle_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void wordle_face_activate(movement_settings_t *settings, void *context); -bool wordle_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void wordle_face_resign(movement_settings_t *settings, void *context); +void wordle_face_setup(uint8_t watch_face_index, void ** context_ptr); +void wordle_face_activate(void *context); +bool wordle_face_loop(movement_event_t event, void *context); +void wordle_face_resign(void *context); #define wordle_face ((const watch_face_t){ \ wordle_face_setup, \ diff --git a/movement/watch_faces/demo/beeps_face.c b/movement/watch_faces/demo/beeps_face.c index 5deeb623..52112719 100644 --- a/movement/watch_faces/demo/beeps_face.c +++ b/movement/watch_faces/demo/beeps_face.c @@ -26,8 +26,7 @@ #include #include "beeps_face.h" -void beeps_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void beeps_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(beeps_state_t)); @@ -36,8 +35,7 @@ void beeps_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v } } -void beeps_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void beeps_face_activate(void *context) { (void) context; } @@ -48,7 +46,7 @@ static void _beep_face_update_lcd(beeps_state_t *state) { watch_display_string(buf, 0); } -bool beeps_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool beeps_face_loop(movement_event_t event, void *context) { beeps_state_t *state = (beeps_state_t *)context; switch (event.event_type) { @@ -237,13 +235,12 @@ bool beeps_face_loop(movement_event_t event, movement_settings_t *settings, void } break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void beeps_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void beeps_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/demo/beeps_face.h b/movement/watch_faces/demo/beeps_face.h index 73606fdb..5e44c907 100644 --- a/movement/watch_faces/demo/beeps_face.h +++ b/movement/watch_faces/demo/beeps_face.h @@ -44,10 +44,10 @@ typedef struct { uint8_t frequency; } beeps_state_t; -void beeps_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void beeps_face_activate(movement_settings_t *settings, void *context); -bool beeps_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void beeps_face_resign(movement_settings_t *settings, void *context); +void beeps_face_setup(uint8_t watch_face_index, void ** context_ptr); +void beeps_face_activate(void *context); +bool beeps_face_loop(movement_event_t event, void *context); +void beeps_face_resign(void *context); #define beeps_face ((const watch_face_t){ \ beeps_face_setup, \ diff --git a/movement/watch_faces/demo/character_set_face.c b/movement/watch_faces/demo/character_set_face.c index 21bbc793..833362ed 100644 --- a/movement/watch_faces/demo/character_set_face.c +++ b/movement/watch_faces/demo/character_set_face.c @@ -27,21 +27,18 @@ #include "character_set_face.h" #include "watch.h" -void character_set_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void character_set_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) *context_ptr = malloc(sizeof(char)); } -void character_set_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void character_set_face_activate(void *context) { char *c = (char *)context; *c = '@'; movement_request_tick_frequency(0); } -bool character_set_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool character_set_face_loop(movement_event_t event, void *context) { char *c = (char *)context; char buf[11]; switch (event.event_type) { @@ -57,14 +54,13 @@ bool character_set_face_loop(movement_event_t event, movement_settings_t *settin movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void character_set_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void character_set_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/demo/character_set_face.h b/movement/watch_faces/demo/character_set_face.h index 2fac26ad..b7c4c26b 100644 --- a/movement/watch_faces/demo/character_set_face.h +++ b/movement/watch_faces/demo/character_set_face.h @@ -38,10 +38,10 @@ #include "movement.h" -void character_set_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void character_set_face_activate(movement_settings_t *settings, void *context); -bool character_set_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void character_set_face_resign(movement_settings_t *settings, void *context); +void character_set_face_setup(uint8_t watch_face_index, void ** context_ptr); +void character_set_face_activate(void *context); +bool character_set_face_loop(movement_event_t event, void *context); +void character_set_face_resign(void *context); #define character_set_face ((const watch_face_t){ \ character_set_face_setup, \ diff --git a/movement/watch_faces/demo/chirpy_demo_face.c b/movement/watch_faces/demo/chirpy_demo_face.c index 5c699018..84e16705 100644 --- a/movement/watch_faces/demo/chirpy_demo_face.c +++ b/movement/watch_faces/demo/chirpy_demo_face.c @@ -96,8 +96,7 @@ static uint8_t short_data[] = { static uint8_t *nanosec_buffer = 0; static uint16_t nanosec_buffer_size = 0; -void chirpy_demo_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void **context_ptr) { - (void)settings; +void chirpy_demo_face_setup(uint8_t watch_face_index, void **context_ptr) { (void)watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(chirpy_demo_state_t)); @@ -107,8 +106,7 @@ void chirpy_demo_face_setup(movement_settings_t *settings, uint8_t watch_face_in // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void chirpy_demo_face_activate(movement_settings_t *settings, void *context) { - (void)settings; +void chirpy_demo_face_activate(void *context) { chirpy_demo_state_t *state = (chirpy_demo_state_t *)context; memset(context, 0, sizeof(chirpy_demo_state_t)); @@ -254,8 +252,7 @@ static void _cdm_setup_chirp(chirpy_demo_state_t *state) { state->tick_state.tick_fun = _cdf_countdown_tick; } -bool chirpy_demo_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void)settings; +bool chirpy_demo_face_loop(movement_event_t event, void *context) { chirpy_demo_state_t *state = (chirpy_demo_state_t *)context; switch (event.event_type) { @@ -323,8 +320,7 @@ bool chirpy_demo_face_loop(movement_event_t event, movement_settings_t *settings return true; } -void chirpy_demo_face_resign(movement_settings_t *settings, void *context) { - (void)settings; +void chirpy_demo_face_resign(void *context) { (void)context; if (nanosec_buffer != 0) { diff --git a/movement/watch_faces/demo/chirpy_demo_face.h b/movement/watch_faces/demo/chirpy_demo_face.h index 90a6133b..a3ada8d8 100644 --- a/movement/watch_faces/demo/chirpy_demo_face.h +++ b/movement/watch_faces/demo/chirpy_demo_face.h @@ -52,10 +52,10 @@ #include "movement.h" -void chirpy_demo_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void chirpy_demo_face_activate(movement_settings_t *settings, void *context); -bool chirpy_demo_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void chirpy_demo_face_resign(movement_settings_t *settings, void *context); +void chirpy_demo_face_setup(uint8_t watch_face_index, void ** context_ptr); +void chirpy_demo_face_activate(void *context); +bool chirpy_demo_face_loop(movement_event_t event, void *context); +void chirpy_demo_face_resign(void *context); #define chirpy_demo_face ((const watch_face_t){ \ chirpy_demo_face_setup, \ diff --git a/movement/watch_faces/demo/demo_face.c b/movement/watch_faces/demo/demo_face.c index 0587a06b..e423b7de 100644 --- a/movement/watch_faces/demo/demo_face.c +++ b/movement/watch_faces/demo/demo_face.c @@ -43,8 +43,7 @@ typedef enum { DEMO_FACE_NUM_FACES } demo_face_index_t; -void demo_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void demo_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(demo_face_index_t)); @@ -52,8 +51,7 @@ void demo_face_setup(movement_settings_t *settings, uint8_t watch_face_index, vo } } -void demo_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void demo_face_activate(void *context) { (void) context; movement_request_tick_frequency(0); // ensure the watch never enters low energy mode @@ -61,8 +59,7 @@ void demo_face_activate(movement_settings_t *settings, void *context) { movement_set_backlight_dwell(3); } -bool demo_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool demo_face_loop(movement_event_t event, void *context) { demo_face_index_t *screen = (demo_face_index_t *)context; switch (event.event_type) { case EVENT_ALARM_BUTTON_UP: @@ -123,14 +120,13 @@ bool demo_face_loop(movement_event_t event, movement_settings_t *settings, void // ignore timeout break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void demo_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void demo_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/demo/demo_face.h b/movement/watch_faces/demo/demo_face.h index 669f3872..ec336e5b 100644 --- a/movement/watch_faces/demo/demo_face.h +++ b/movement/watch_faces/demo/demo_face.h @@ -38,10 +38,10 @@ #include "movement.h" -void demo_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void demo_face_activate(movement_settings_t *settings, void *context); -bool demo_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void demo_face_resign(movement_settings_t *settings, void *context); +void demo_face_setup(uint8_t watch_face_index, void ** context_ptr); +void demo_face_activate(void *context); +bool demo_face_loop(movement_event_t event, void *context); +void demo_face_resign(void *context); #define demo_face ((const watch_face_t){ \ demo_face_setup, \ diff --git a/movement/watch_faces/demo/frequency_correction_face.c b/movement/watch_faces/demo/frequency_correction_face.c index 17457177..916f1353 100644 --- a/movement/watch_faces/demo/frequency_correction_face.c +++ b/movement/watch_faces/demo/frequency_correction_face.c @@ -69,8 +69,7 @@ static void _disable_output() { while (RTC->MODE2.SYNCBUSY.bit.ENABLE); } -void frequency_correction_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void frequency_correction_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(frequency_correction_state_t)); @@ -79,14 +78,12 @@ void frequency_correction_face_setup(movement_settings_t *settings, uint8_t watc } } -void frequency_correction_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void frequency_correction_face_activate(void *context) { frequency_correction_state_t *state = (frequency_correction_state_t *)context; _enable_output(state->period_event_output); } -bool frequency_correction_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool frequency_correction_face_loop(movement_event_t event, void *context) { frequency_correction_state_t *state = (frequency_correction_state_t *)context; int8_t freqcorr; @@ -123,15 +120,14 @@ bool frequency_correction_face_loop(movement_event_t event, movement_settings_t watch_start_tick_animation(500); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void frequency_correction_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void frequency_correction_face_resign(void *context) { (void) context; _disable_output(); @@ -139,27 +135,23 @@ void frequency_correction_face_resign(movement_settings_t *settings, void *conte #else -void frequency_correction_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void frequency_correction_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; (void) context_ptr; } -void frequency_correction_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void frequency_correction_face_activate(void *context) { (void) context; } -bool frequency_correction_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool frequency_correction_face_loop(movement_event_t event, void *context) { (void) context; (void) event; return true; } -void frequency_correction_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void frequency_correction_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/demo/frequency_correction_face.h b/movement/watch_faces/demo/frequency_correction_face.h index 0b9c435d..7d25866a 100644 --- a/movement/watch_faces/demo/frequency_correction_face.h +++ b/movement/watch_faces/demo/frequency_correction_face.h @@ -43,10 +43,10 @@ typedef struct { uint8_t period_event_output; } frequency_correction_state_t; -void frequency_correction_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void frequency_correction_face_activate(movement_settings_t *settings, void *context); -bool frequency_correction_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void frequency_correction_face_resign(movement_settings_t *settings, void *context); +void frequency_correction_face_setup(uint8_t watch_face_index, void ** context_ptr); +void frequency_correction_face_activate(void *context); +bool frequency_correction_face_loop(movement_event_t event, void *context); +void frequency_correction_face_resign(void *context); #define frequency_correction_face ((const watch_face_t){ \ frequency_correction_face_setup, \ diff --git a/movement/watch_faces/demo/hello_there_face.c b/movement/watch_faces/demo/hello_there_face.c index 97af2579..39ab8bc1 100644 --- a/movement/watch_faces/demo/hello_there_face.c +++ b/movement/watch_faces/demo/hello_there_face.c @@ -27,10 +27,9 @@ #include "hello_there_face.h" #include "watch.h" -void hello_there_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void hello_there_face_setup(uint8_t watch_face_index, void ** context_ptr) { // These next two lines just silence the compiler warnings associated with unused parameters. // We have no use for the settings or the watch_face_index, so we make that explicit here. - (void) settings; (void) watch_face_index; // At boot, context_ptr will be NULL indicating that we don't have anyplace to store our context. if (*context_ptr == NULL) { @@ -39,9 +38,8 @@ void hello_there_face_setup(movement_settings_t *settings, uint8_t watch_face_in } } -void hello_there_face_activate(movement_settings_t *settings, void *context) { +void hello_there_face_activate(void *context) { // same as above: silence the warning, we don't need to check the settings. - (void) settings; // we do however need to set some things in our context. Here we cast it to the correct type... hello_there_state_t *state = (hello_there_state_t *)context; // ...and set the initial state of our watch face. We start out displaying the word 'Hello', @@ -50,8 +48,7 @@ void hello_there_face_activate(movement_settings_t *settings, void *context) { state->animating = true; } -bool hello_there_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool hello_there_face_loop(movement_event_t event, void *context) { hello_there_state_t *state = (hello_there_state_t *)context; switch (event.event_type) { @@ -87,16 +84,15 @@ bool hello_there_face_loop(movement_event_t event, movement_settings_t *settings movement_move_to_face(0); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void hello_there_face_resign(movement_settings_t *settings, void *context) { +void hello_there_face_resign(void *context) { // our watch face, like most watch faces, has nothing special to do when resigning. // watch faces that enable a peripheral or interact with a sensor may want to turn it off here. - (void) settings; (void) context; } diff --git a/movement/watch_faces/demo/hello_there_face.h b/movement/watch_faces/demo/hello_there_face.h index dc76f5f5..df942d05 100644 --- a/movement/watch_faces/demo/hello_there_face.h +++ b/movement/watch_faces/demo/hello_there_face.h @@ -39,10 +39,10 @@ typedef struct { bool animating; } hello_there_state_t; -void hello_there_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void hello_there_face_activate(movement_settings_t *settings, void *context); -bool hello_there_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void hello_there_face_resign(movement_settings_t *settings, void *context); +void hello_there_face_setup(uint8_t watch_face_index, void ** context_ptr); +void hello_there_face_activate(void *context); +bool hello_there_face_loop(movement_event_t event, void *context); +void hello_there_face_resign(void *context); #define hello_there_face ((const watch_face_t){ \ hello_there_face_setup, \ diff --git a/movement/watch_faces/demo/lis2dw_logging_face.c b/movement/watch_faces/demo/lis2dw_logging_face.c index 4e87e2c3..9792a745 100644 --- a/movement/watch_faces/demo/lis2dw_logging_face.c +++ b/movement/watch_faces/demo/lis2dw_logging_face.c @@ -36,7 +36,7 @@ // Pressing the alarm button enters the log mode, where the main display shows the number of interrupts detected in each of the last // 24 hours (the hour is shown in the top right digit and AM/PM indicator, if the clock is set to 12 hour mode) -static void _lis2dw_logging_face_update_display(movement_settings_t *settings, lis2dw_logger_state_t *logger_state, lis2dw_wakeup_source wakeup_source) { +static void _lis2dw_logging_face_update_display(lis2dw_logger_state_t *logger_state, lis2dw_wakeup_source wakeup_source) { char buf[14]; char time_indication_character; int8_t pos; @@ -111,8 +111,7 @@ static void _lis2dw_logging_face_log_data(lis2dw_logger_state_t *logger_state) { logger_state->z_interrupts_this_hour = 0; } -void lis2dw_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void lis2dw_logging_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(lis2dw_logger_state_t)); @@ -128,15 +127,14 @@ void lis2dw_logging_face_setup(movement_settings_t *settings, uint8_t watch_face } } -void lis2dh_logging_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void lis2dh_logging_face_activate(void *context) { lis2dh_logger_state_t *logger_state = (lis2dh_logger_state_t *)context; logger_state->display_index = 0; logger_state->log_ticks = 0; watch_enable_digital_input(A4); } -bool lis2dw_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool lis2dw_logging_face_loop(movement_event_t event, void *context) { lis2dw_logger_state_t *logger_state = (lis2dw_logger_state_t *)context; lis2dw_wakeup_source wakeup_source = 0; lis2dw_interrupt_source interrupt_source = 0; @@ -145,13 +143,13 @@ bool lis2dw_logging_face_loop(movement_event_t event, movement_settings_t *setti case EVENT_LIGHT_BUTTON_DOWN: logger_state->axis_index = (logger_state->axis_index + 1) % 4; logger_state->log_ticks = 255; - _lis2dw_logging_face_update_display(settings, logger_state, wakeup_source); + _lis2dw_logging_face_update_display(logger_state, wakeup_source); break; case EVENT_ALARM_BUTTON_UP: if (logger_state->log_ticks) logger_state->display_index = (logger_state->display_index + 1) % LIS2DW_LOGGING_NUM_DATA_POINTS; logger_state->log_ticks = 255; logger_state->axis_index = 0; - _lis2dw_logging_face_update_display(settings, logger_state, wakeup_source); + _lis2dw_logging_face_update_display(logger_state, wakeup_source); break; case EVENT_ACTIVATE: case EVENT_TICK: @@ -171,27 +169,25 @@ bool lis2dw_logging_face_loop(movement_event_t event, movement_settings_t *setti } else { watch_clear_indicator(WATCH_INDICATOR_SIGNAL); } - _lis2dw_logging_face_update_display(settings, logger_state, wakeup_source); + _lis2dw_logging_face_update_display(logger_state, wakeup_source); break; case EVENT_BACKGROUND_TASK: _lis2dw_logging_face_log_data(logger_state); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void lis2dw_logging_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void lis2dw_logging_face_resign(void *context) { (void) context; watch_disable_digital_input(A4); } -bool lis2dw_logging_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool lis2dw_logging_face_wants_background_task(void *context) { lis2dw_logger_state_t *logger_state = (lis2dw_logger_state_t *)context; watch_date_time date_time = watch_rtc_get_date_time(); diff --git a/movement/watch_faces/demo/lis2dw_logging_face.h b/movement/watch_faces/demo/lis2dw_logging_face.h index ad325184..0272cd8f 100644 --- a/movement/watch_faces/demo/lis2dw_logging_face.h +++ b/movement/watch_faces/demo/lis2dw_logging_face.h @@ -57,11 +57,11 @@ typedef struct { lis2dw_logger_data_point_t data[LIS2DW_LOGGING_NUM_DATA_POINTS]; } lis2dw_logger_state_t; -void lis2dw_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void lis2dw_logging_face_activate(movement_settings_t *settings, void *context); -bool lis2dw_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void lis2dw_logging_face_resign(movement_settings_t *settings, void *context); -bool lis2dw_logging_face_wants_background_task(movement_settings_t *settings, void *context); +void lis2dw_logging_face_setup(uint8_t watch_face_index, void ** context_ptr); +void lis2dw_logging_face_activate(void *context); +bool lis2dw_logging_face_loop(movement_event_t event, void *context); +void lis2dw_logging_face_resign(void *context); +bool lis2dw_logging_face_wants_background_task(void *context); #define lis2dw_logging_face ((const watch_face_t){ \ lis2dw_logging_face_setup, \ diff --git a/movement/watch_faces/demo/voltage_face.c b/movement/watch_faces/demo/voltage_face.c index d224851b..75f4adb0 100644 --- a/movement/watch_faces/demo/voltage_face.c +++ b/movement/watch_faces/demo/voltage_face.c @@ -39,19 +39,16 @@ static void _voltage_face_update_display(void) { watch_display_string(buf, 0); } -void voltage_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void voltage_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; (void) context_ptr; } -void voltage_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void voltage_face_activate(void *context) { (void) context; } -bool voltage_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool voltage_face_loop(movement_event_t event, void *context) { (void) context; watch_date_time date_time; switch (event.event_type) { @@ -81,14 +78,13 @@ bool voltage_face_loop(movement_event_t event, movement_settings_t *settings, vo } break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void voltage_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void voltage_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/demo/voltage_face.h b/movement/watch_faces/demo/voltage_face.h index 59d0f9ea..92576715 100644 --- a/movement/watch_faces/demo/voltage_face.h +++ b/movement/watch_faces/demo/voltage_face.h @@ -38,10 +38,10 @@ #include "movement.h" -void voltage_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void voltage_face_activate(movement_settings_t *settings, void *context); -bool voltage_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void voltage_face_resign(movement_settings_t *settings, void *context); +void voltage_face_setup(uint8_t watch_face_index, void ** context_ptr); +void voltage_face_activate(void *context); +bool voltage_face_loop(movement_event_t event, void *context); +void voltage_face_resign(void *context); #define voltage_face ((const watch_face_t){ \ voltage_face_setup, \ diff --git a/movement/watch_faces/sensor/accel_interrupt_count_face.c b/movement/watch_faces/sensor/accel_interrupt_count_face.c index b0eb28d5..82679c54 100644 --- a/movement/watch_faces/sensor/accel_interrupt_count_face.c +++ b/movement/watch_faces/sensor/accel_interrupt_count_face.c @@ -55,8 +55,7 @@ static void _accel_interrupt_count_face_configure_threshold(uint8_t threshold) { lis2dw_configure_wakeup_int1(threshold, false, true); } -void accel_interrupt_count_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void accel_interrupt_count_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(accel_interrupt_count_state_t)); @@ -75,7 +74,7 @@ void accel_interrupt_count_face_setup(movement_settings_t *settings, uint8_t wat } } -void accel_interrupt_count_face_activate(movement_settings_t *settings, void *context) { +void accel_interrupt_count_face_activate(void *context) { accel_interrupt_count_state_t *state = (accel_interrupt_count_state_t *)context; // never in settings mode at the start @@ -85,7 +84,7 @@ void accel_interrupt_count_face_activate(movement_settings_t *settings, void *co movement_set_low_energy_timeout(0); } -bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool accel_interrupt_count_face_loop(movement_event_t event, void *context) { accel_interrupt_count_state_t *state = (accel_interrupt_count_state_t *)context; if (state->is_setting) { @@ -107,7 +106,7 @@ bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t state->is_setting = false; break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } } else { @@ -142,7 +141,7 @@ bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t } return false; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } } @@ -150,13 +149,11 @@ bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t return true; } -void accel_interrupt_count_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void accel_interrupt_count_face_resign(void *context) { (void) context; } -bool accel_interrupt_count_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool accel_interrupt_count_face_wants_background_task(void *context) { (void) context; return false; } diff --git a/movement/watch_faces/sensor/accel_interrupt_count_face.h b/movement/watch_faces/sensor/accel_interrupt_count_face.h index 3308b017..0f91363d 100644 --- a/movement/watch_faces/sensor/accel_interrupt_count_face.h +++ b/movement/watch_faces/sensor/accel_interrupt_count_face.h @@ -43,11 +43,11 @@ typedef struct { bool is_setting; } accel_interrupt_count_state_t; -void accel_interrupt_count_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void accel_interrupt_count_face_activate(movement_settings_t *settings, void *context); -bool accel_interrupt_count_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void accel_interrupt_count_face_resign(movement_settings_t *settings, void *context); -bool accel_interrupt_count_face_wants_background_task(movement_settings_t *settings, void *context); +void accel_interrupt_count_face_setup(uint8_t watch_face_index, void ** context_ptr); +void accel_interrupt_count_face_activate(void *context); +bool accel_interrupt_count_face_loop(movement_event_t event, void *context); +void accel_interrupt_count_face_resign(void *context); +bool accel_interrupt_count_face_wants_background_task(void *context); #define accel_interrupt_count_face ((const watch_face_t){ \ accel_interrupt_count_face_setup, \ diff --git a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c index 5acb9f09..f5548f5c 100644 --- a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c +++ b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.c @@ -56,7 +56,7 @@ static const char activity_types[][3] = { static void update(accelerometer_data_acquisition_state_t *state); static void update_settings(accelerometer_data_acquisition_state_t *state); static void advance_current_setting(accelerometer_data_acquisition_state_t *state); -static void start_reading(accelerometer_data_acquisition_state_t *state, movement_settings_t *settings); +static void start_reading(accelerometer_data_acquisition_state_t *state); static void continue_reading(accelerometer_data_acquisition_state_t *state); static void finish_reading(accelerometer_data_acquisition_state_t *state); static bool wait_for_flash_ready(void); @@ -65,8 +65,7 @@ static void write_buffer_to_page(uint8_t *buf, uint16_t page); static void write_page(accelerometer_data_acquisition_state_t *state); static void log_data_point(accelerometer_data_acquisition_state_t *state, lis2dw_reading_t reading, uint8_t centiseconds); -void accelerometer_data_acquisition_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void accelerometer_data_acquisition_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; accelerometer_data_acquisition_state_t *state = (accelerometer_data_acquisition_state_t *)*context_ptr; if (*context_ptr == NULL) { @@ -92,14 +91,12 @@ void accelerometer_data_acquisition_face_setup(movement_settings_t *settings, ui } -void accelerometer_data_acquisition_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void accelerometer_data_acquisition_face_activate(void *context) { accelerometer_data_acquisition_state_t *state = (accelerometer_data_acquisition_state_t *)context; state->next_available_page = get_next_available_page(); } -bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool accelerometer_data_acquisition_face_loop(movement_event_t event, void *context) { accelerometer_data_acquisition_state_t *state = (accelerometer_data_acquisition_state_t *)context; switch (event.event_type) { @@ -131,7 +128,7 @@ bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_s state->reading_ticks = SECONDS_TO_RECORD + 1; // also beep if the user asked for it if (state->beep_with_countdown) watch_buzzer_play_note(BUZZER_NOTE_C6, 75); - start_reading(state, settings); + start_reading(state); } else if (state->countdown_ticks < 3) { // beep for last two ticks before reading if (state->beep_with_countdown) watch_buzzer_play_note(BUZZER_NOTE_C5, 75); @@ -218,15 +215,14 @@ bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_s // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void accelerometer_data_acquisition_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void accelerometer_data_acquisition_face_resign(void *context) { accelerometer_data_acquisition_state_t *state = (accelerometer_data_acquisition_state_t *)context; if (state->reading_ticks) { state->reading_ticks = 0; @@ -429,7 +425,7 @@ static void log_data_point(accelerometer_data_acquisition_state_t *state, lis2dw } } -static void start_reading(accelerometer_data_acquisition_state_t *state, movement_settings_t *settings) { +static void start_reading(accelerometer_data_acquisition_state_t *state) { printf("Start reading\n"); watch_enable_i2c(); lis2dw_begin(); diff --git a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h index 946639da..107faeaf 100644 --- a/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h +++ b/movement/watch_faces/sensor/accelerometer_data_acquisition_face.h @@ -101,10 +101,10 @@ typedef struct { uint16_t pos; } accelerometer_data_acquisition_state_t; -void accelerometer_data_acquisition_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void accelerometer_data_acquisition_face_activate(movement_settings_t *settings, void *context); -bool accelerometer_data_acquisition_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void accelerometer_data_acquisition_face_resign(movement_settings_t *settings, void *context); +void accelerometer_data_acquisition_face_setup(uint8_t watch_face_index, void ** context_ptr); +void accelerometer_data_acquisition_face_activate(void *context); +bool accelerometer_data_acquisition_face_loop(movement_event_t event, void *context); +void accelerometer_data_acquisition_face_resign(void *context); #define accelerometer_data_acquisition_face ((const watch_face_t){ \ accelerometer_data_acquisition_face_setup, \ diff --git a/movement/watch_faces/sensor/alarm_thermometer_face.c b/movement/watch_faces/sensor/alarm_thermometer_face.c index e4827e3d..63e6a8a4 100644 --- a/movement/watch_faces/sensor/alarm_thermometer_face.c +++ b/movement/watch_faces/sensor/alarm_thermometer_face.c @@ -48,8 +48,7 @@ static void _alarm_thermometer_face_clear(int last[]) { } } -void alarm_thermometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void alarm_thermometer_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(alarm_thermometer_state_t)); @@ -57,15 +56,14 @@ void alarm_thermometer_face_setup(movement_settings_t *settings, uint8_t watch_f } } -void alarm_thermometer_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void alarm_thermometer_face_activate(void *context) { alarm_thermometer_state_t *state = (alarm_thermometer_state_t *)context; state->mode = MODE_NORMAL; _alarm_thermometer_face_clear(state->last); watch_display_string("AT", 0); } -bool alarm_thermometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool alarm_thermometer_face_loop(movement_event_t event, void *context) { alarm_thermometer_state_t *state = (alarm_thermometer_state_t *)context; switch (event.event_type) { @@ -142,13 +140,12 @@ bool alarm_thermometer_face_loop(movement_event_t event, movement_settings_t *se } break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void alarm_thermometer_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void alarm_thermometer_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/sensor/alarm_thermometer_face.h b/movement/watch_faces/sensor/alarm_thermometer_face.h index 1b3aabf4..6b1ecde7 100644 --- a/movement/watch_faces/sensor/alarm_thermometer_face.h +++ b/movement/watch_faces/sensor/alarm_thermometer_face.h @@ -58,10 +58,10 @@ typedef struct { alarm_thermometer_mode_t mode; } alarm_thermometer_state_t; -void alarm_thermometer_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void alarm_thermometer_face_activate(movement_settings_t *settings, void *context); -bool alarm_thermometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void alarm_thermometer_face_resign(movement_settings_t *settings, void *context); +void alarm_thermometer_face_setup(uint8_t watch_face_index, void ** context_ptr); +void alarm_thermometer_face_activate(void *context); +bool alarm_thermometer_face_loop(movement_event_t event, void *context); +void alarm_thermometer_face_resign(void *context); #define alarm_thermometer_face ((const watch_face_t){ \ alarm_thermometer_face_setup, \ diff --git a/movement/watch_faces/sensor/lightmeter_face.c b/movement/watch_faces/sensor/lightmeter_face.c index 9fb489a2..243613c1 100644 --- a/movement/watch_faces/sensor/lightmeter_face.c +++ b/movement/watch_faces/sensor/lightmeter_face.c @@ -31,8 +31,7 @@ uint16_t lightmeter_mod(uint16_t m, uint16_t n) { return (m%n + n)%n; } -void lightmeter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void lightmeter_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(lightmeter_state_t)); @@ -45,8 +44,7 @@ void lightmeter_face_setup(movement_settings_t *settings, uint8_t watch_face_ind } } -void lightmeter_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void lightmeter_face_activate(void *context) { lightmeter_state_t *state = (lightmeter_state_t*) context; state->waiting_for_conversion = 0; lightmeter_show_ev(state); // Print most current reading @@ -101,8 +99,7 @@ void lightmeter_show_ev(lightmeter_state_t *state) { return; } -bool lightmeter_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool lightmeter_face_loop(movement_event_t event, void *context) { lightmeter_state_t *state = (lightmeter_state_t*) context; opt3001_Config_t c; @@ -160,14 +157,13 @@ bool lightmeter_face_loop(movement_event_t event, movement_settings_t *settings, break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void lightmeter_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void lightmeter_face_resign(void *context) { (void) context; opt3001_writeConfig(lightmeter_addr, lightmeter_off); watch_disable_i2c(); diff --git a/movement/watch_faces/sensor/lightmeter_face.h b/movement/watch_faces/sensor/lightmeter_face.h index affae2e4..fcb7cdae 100644 --- a/movement/watch_faces/sensor/lightmeter_face.h +++ b/movement/watch_faces/sensor/lightmeter_face.h @@ -172,11 +172,11 @@ static const opt3001_Config_t lightmeter_off = { uint16_t lightmeter_mod(uint16_t m, uint16_t n); -void lightmeter_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void lightmeter_face_activate(movement_settings_t *settings, void *context); +void lightmeter_face_setup(uint8_t watch_face_index, void ** context_ptr); +void lightmeter_face_activate(void *context); void lightmeter_show_ev(lightmeter_state_t *state); -bool lightmeter_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void lightmeter_face_resign(movement_settings_t *settings, void *context); +bool lightmeter_face_loop(movement_event_t event, void *context); +void lightmeter_face_resign(void *context); static const uint8_t lightmeter_addr = 0x44; diff --git a/movement/watch_faces/sensor/minmax_face.c b/movement/watch_faces/sensor/minmax_face.c index f35760c6..10e2a9ed 100644 --- a/movement/watch_faces/sensor/minmax_face.c +++ b/movement/watch_faces/sensor/minmax_face.c @@ -83,8 +83,7 @@ static void _minmax_face_update_display(float temperature_c, bool in_fahrenheit) } -void minmax_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void minmax_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(minmax_state_t)); @@ -93,14 +92,13 @@ void minmax_face_setup(movement_settings_t *settings, uint8_t watch_face_index, } -void minmax_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void minmax_face_activate(void *context) { minmax_state_t *state = (minmax_state_t *)context; state->show_min = true; watch_display_string("MN", 0); // Start with minimum temp } -bool minmax_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool minmax_face_loop(movement_event_t event, void *context) { minmax_state_t *state = (minmax_state_t *)context; float temp_c; @@ -134,20 +132,18 @@ bool minmax_face_loop(movement_event_t event, movement_settings_t *settings, voi _minmax_face_log_data(state); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void minmax_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void minmax_face_resign(void *context) { (void) context; } -bool minmax_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool minmax_face_wants_background_task(void *context) { (void) context; // this will get called at the top of each minute; always request bg task return true; diff --git a/movement/watch_faces/sensor/minmax_face.h b/movement/watch_faces/sensor/minmax_face.h index 1fd3c48d..4faf6794 100644 --- a/movement/watch_faces/sensor/minmax_face.h +++ b/movement/watch_faces/sensor/minmax_face.h @@ -51,11 +51,11 @@ typedef struct { float hourly_maxs[LOGGING_DATA_POINTS]; } minmax_state_t; -void minmax_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void minmax_face_activate(movement_settings_t *settings, void *context); -bool minmax_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void minmax_face_resign(movement_settings_t *settings, void *context); -bool minmax_face_wants_background_task(movement_settings_t *settings, void *context); +void minmax_face_setup(uint8_t watch_face_index, void ** context_ptr); +void minmax_face_activate(void *context); +bool minmax_face_loop(movement_event_t event, void *context); +void minmax_face_resign(void *context); +bool minmax_face_wants_background_task(void *context); #define minmax_face ((const watch_face_t){ \ minmax_face_setup, \ diff --git a/movement/watch_faces/sensor/thermistor_logging_face.c b/movement/watch_faces/sensor/thermistor_logging_face.c index 7c8d5b98..fe34e2cc 100644 --- a/movement/watch_faces/sensor/thermistor_logging_face.c +++ b/movement/watch_faces/sensor/thermistor_logging_face.c @@ -72,8 +72,7 @@ static void _thermistor_logging_face_update_display(thermistor_logger_state_t *l watch_display_string(buf, 0); } -void thermistor_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void thermistor_logging_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(thermistor_logger_state_t)); @@ -81,14 +80,13 @@ void thermistor_logging_face_setup(movement_settings_t *settings, uint8_t watch_ } } -void thermistor_logging_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void thermistor_logging_face_activate(void *context) { thermistor_logger_state_t *logger_state = (thermistor_logger_state_t *)context; logger_state->display_index = 0; logger_state->ts_ticks = 0; } -bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool thermistor_logging_face_loop(movement_event_t event, void *context) { thermistor_logger_state_t *logger_state = (thermistor_logger_state_t *)context; switch (event.event_type) { case EVENT_TIMEOUT: @@ -118,20 +116,18 @@ bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *s _thermistor_logging_face_log_data(logger_state); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void thermistor_logging_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void thermistor_logging_face_resign(void *context) { (void) context; } -bool thermistor_logging_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool thermistor_logging_face_wants_background_task(void *context) { (void) context; // this will get called at the top of each minute, so all we check is if we're at the top of the hour as well. // if we are, we ask for a background task. diff --git a/movement/watch_faces/sensor/thermistor_logging_face.h b/movement/watch_faces/sensor/thermistor_logging_face.h index 0debfbf4..346f23f7 100644 --- a/movement/watch_faces/sensor/thermistor_logging_face.h +++ b/movement/watch_faces/sensor/thermistor_logging_face.h @@ -70,11 +70,11 @@ typedef struct { thermistor_logger_data_point_t data[THERMISTOR_LOGGING_NUM_DATA_POINTS]; } thermistor_logger_state_t; -void thermistor_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void thermistor_logging_face_activate(movement_settings_t *settings, void *context); -bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void thermistor_logging_face_resign(movement_settings_t *settings, void *context); -bool thermistor_logging_face_wants_background_task(movement_settings_t *settings, void *context); +void thermistor_logging_face_setup(uint8_t watch_face_index, void ** context_ptr); +void thermistor_logging_face_activate(void *context); +bool thermistor_logging_face_loop(movement_event_t event, void *context); +void thermistor_logging_face_resign(void *context); +bool thermistor_logging_face_wants_background_task(void *context); #define thermistor_logging_face ((const watch_face_t){ \ thermistor_logging_face_setup, \ diff --git a/movement/watch_faces/sensor/thermistor_readout_face.c b/movement/watch_faces/sensor/thermistor_readout_face.c index 74b3ef75..32df0d13 100644 --- a/movement/watch_faces/sensor/thermistor_readout_face.c +++ b/movement/watch_faces/sensor/thermistor_readout_face.c @@ -41,19 +41,17 @@ static void _thermistor_readout_face_update_display(bool in_fahrenheit) { thermistor_driver_disable(); } -void thermistor_readout_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void thermistor_readout_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; (void) context_ptr; } -void thermistor_readout_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void thermistor_readout_face_activate(void *context) { (void) context; watch_display_string("TE", 0); } -bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool thermistor_readout_face_loop(movement_event_t event, void *context) { (void) context; watch_date_time date_time = watch_rtc_get_date_time(); switch (event.event_type) { @@ -90,14 +88,13 @@ bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *s } break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void thermistor_readout_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void thermistor_readout_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/sensor/thermistor_readout_face.h b/movement/watch_faces/sensor/thermistor_readout_face.h index 10cdcc19..6ca5a1a0 100644 --- a/movement/watch_faces/sensor/thermistor_readout_face.h +++ b/movement/watch_faces/sensor/thermistor_readout_face.h @@ -50,10 +50,10 @@ #include "movement.h" -void thermistor_readout_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void thermistor_readout_face_activate(movement_settings_t *settings, void *context); -bool thermistor_readout_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void thermistor_readout_face_resign(movement_settings_t *settings, void *context); +void thermistor_readout_face_setup(uint8_t watch_face_index, void ** context_ptr); +void thermistor_readout_face_activate(void *context); +bool thermistor_readout_face_loop(movement_event_t event, void *context); +void thermistor_readout_face_resign(void *context); #define thermistor_readout_face ((const watch_face_t){ \ thermistor_readout_face_setup, \ diff --git a/movement/watch_faces/sensor/thermistor_testing_face.c b/movement/watch_faces/sensor/thermistor_testing_face.c index 26b8e001..964ef448 100644 --- a/movement/watch_faces/sensor/thermistor_testing_face.c +++ b/movement/watch_faces/sensor/thermistor_testing_face.c @@ -41,7 +41,7 @@ static void _thermistor_testing_face_update_display(bool in_fahrenheit) { thermistor_driver_disable(); } -void thermistor_testing_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void thermistor_testing_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; (void) context_ptr; // force one setting: never enter low energy mode. @@ -49,14 +49,13 @@ void thermistor_testing_face_setup(movement_settings_t *settings, uint8_t watch_ movement_set_low_energy_timeout(0); } -void thermistor_testing_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void thermistor_testing_face_activate(void *context) { (void) context; watch_display_string("TE", 0); movement_request_tick_frequency(8); } -bool thermistor_testing_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool thermistor_testing_face_loop(movement_event_t event, void *context) { (void) context; switch (event.event_type) { case EVENT_ALARM_BUTTON_DOWN: @@ -68,14 +67,13 @@ bool thermistor_testing_face_loop(movement_event_t event, movement_settings_t *s _thermistor_testing_face_update_display(movement_use_imperial_units()); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void thermistor_testing_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void thermistor_testing_face_resign(void *context) { (void) context; } diff --git a/movement/watch_faces/sensor/thermistor_testing_face.h b/movement/watch_faces/sensor/thermistor_testing_face.h index 9721484a..e1efcaa0 100644 --- a/movement/watch_faces/sensor/thermistor_testing_face.h +++ b/movement/watch_faces/sensor/thermistor_testing_face.h @@ -38,10 +38,10 @@ #include "movement.h" -void thermistor_testing_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void thermistor_testing_face_activate(movement_settings_t *settings, void *context); -bool thermistor_testing_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void thermistor_testing_face_resign(movement_settings_t *settings, void *context); +void thermistor_testing_face_setup(uint8_t watch_face_index, void ** context_ptr); +void thermistor_testing_face_activate(void *context); +bool thermistor_testing_face_loop(movement_event_t event, void *context); +void thermistor_testing_face_resign(void *context); #define thermistor_testing_face ((const watch_face_t){ \ thermistor_testing_face_setup, \ diff --git a/movement/watch_faces/settings/finetune_face.c b/movement/watch_faces/settings/finetune_face.c index 67680ed9..0d225ca2 100644 --- a/movement/watch_faces/settings/finetune_face.c +++ b/movement/watch_faces/settings/finetune_face.c @@ -34,15 +34,13 @@ extern nanosec_state_t nanosec_state; int total_adjustment; int8_t finetune_page; -void finetune_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void finetune_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; (void) context_ptr; // Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep. } -void finetune_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void finetune_face_activate(void *context) { (void) context; // Handle any tasks related to your watch face coming on screen. @@ -131,9 +129,8 @@ static void finetune_update_correction_time(void) { movement_move_to_face(0); // Go to main face after saving settings } -bool finetune_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool finetune_face_loop(movement_event_t event, void *context) { - (void) settings; (void) context; switch (event.event_type) { @@ -227,7 +224,7 @@ bool finetune_face_loop(movement_event_t event, movement_settings_t *settings, v // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } @@ -236,8 +233,7 @@ bool finetune_face_loop(movement_event_t event, movement_settings_t *settings, v return true; } -void finetune_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void finetune_face_resign(void *context) { (void) context; if (total_adjustment != 0) { diff --git a/movement/watch_faces/settings/finetune_face.h b/movement/watch_faces/settings/finetune_face.h index 95ac5705..905df760 100644 --- a/movement/watch_faces/settings/finetune_face.h +++ b/movement/watch_faces/settings/finetune_face.h @@ -60,10 +60,10 @@ typedef struct { uint8_t unused; } finetune_state_t; -void finetune_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void finetune_face_activate(movement_settings_t *settings, void *context); -bool finetune_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void finetune_face_resign(movement_settings_t *settings, void *context); +void finetune_face_setup(uint8_t watch_face_index, void ** context_ptr); +void finetune_face_activate(void *context); +bool finetune_face_loop(movement_event_t event, void *context); +void finetune_face_resign(void *context); #define finetune_face ((const watch_face_t){ \ finetune_face_setup, \ diff --git a/movement/watch_faces/settings/nanosec_face.c b/movement/watch_faces/settings/nanosec_face.c index 37dd08ef..965fdc6b 100644 --- a/movement/watch_faces/settings/nanosec_face.c +++ b/movement/watch_faces/settings/nanosec_face.c @@ -146,9 +146,8 @@ void nanosec_save(void) { nanosec_changed = false; } -void nanosec_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { +void nanosec_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; - (void) settings; if (*context_ptr == NULL) { if (filesystem_get_file_size("nanosec.ini") != sizeof(nanosec_state)) { @@ -167,8 +166,7 @@ void nanosec_face_setup(movement_settings_t *settings, uint8_t watch_face_index, } } -void nanosec_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void nanosec_face_activate(void *context) { (void) context; // Handle any tasks related to your watch face coming on screen. @@ -267,8 +265,7 @@ float nanosec_get_aging() // Returns aging correction in ppm } -bool nanosec_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool nanosec_face_loop(movement_event_t event, void *context) { (void) context; switch (event.event_type) { @@ -348,7 +345,7 @@ bool nanosec_face_loop(movement_event_t event, movement_settings_t *settings, vo // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } @@ -357,16 +354,14 @@ bool nanosec_face_loop(movement_event_t event, movement_settings_t *settings, vo return true; } -void nanosec_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void nanosec_face_resign(void *context) { (void) context; nanosec_ui_save(); } // Background freq correction -bool nanosec_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool nanosec_face_wants_background_task(void *context) { (void) context; if (nanosec_state.correction_profile == 0) return 0; // No need for background correction if we are on profile 0 - static hardware correction. diff --git a/movement/watch_faces/settings/nanosec_face.h b/movement/watch_faces/settings/nanosec_face.h index 545eed29..58167ee7 100644 --- a/movement/watch_faces/settings/nanosec_face.h +++ b/movement/watch_faces/settings/nanosec_face.h @@ -86,11 +86,11 @@ typedef struct { int16_t aging_ppm_pa; // multiplied by 100. Aging per year. } nanosec_state_t; -void nanosec_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void nanosec_face_activate(movement_settings_t *settings, void *context); -bool nanosec_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void nanosec_face_resign(movement_settings_t *settings, void *context); -bool nanosec_face_wants_background_task(movement_settings_t *settings, void *context); +void nanosec_face_setup(uint8_t watch_face_index, void ** context_ptr); +void nanosec_face_activate(void *context); +bool nanosec_face_loop(movement_event_t event, void *context); +void nanosec_face_resign(void *context); +bool nanosec_face_wants_background_task(void *context); void nanosec_ui_save(void); void nanosec_save(void); float nanosec_get_aging(void); diff --git a/movement/watch_faces/settings/place_face.h b/movement/watch_faces/settings/place_face.h index a98c2642..94bf1643 100644 --- a/movement/watch_faces/settings/place_face.h +++ b/movement/watch_faces/settings/place_face.h @@ -211,10 +211,10 @@ typedef struct { // PUBLIC WATCH FACE FUNCTIONS //////////////////////////////////////////////// -void place_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void place_face_activate(movement_settings_t *settings, void *context); -bool place_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void place_face_resign(movement_settings_t *settings, void *context); +void place_face_setup(uint8_t watch_face_index, void ** context_ptr); +void place_face_activate(void *context); +bool place_face_loop(movement_event_t event, void *context); +void place_face_resign(void *context); void place_latlon_to_olc(char *pluscode, double latitude, double longitude); void place_latlon_to_geohash(char *geohash, double latitude, double longitude); diff --git a/movement/watch_faces/settings/save_load_face.c b/movement/watch_faces/settings/save_load_face.c index 03358726..d298229d 100644 --- a/movement/watch_faces/settings/save_load_face.c +++ b/movement/watch_faces/settings/save_load_face.c @@ -46,7 +46,7 @@ static void save(save_load_state_t *state) { filesystem_write_file(filename, (char*)&savefile, sizeof(savefile_t)); } -static void load(save_load_state_t *state, movement_settings_t *settings) { +static void load(save_load_state_t *state) { watch_store_backup_data(state->slot[state->index].b0, 0); watch_store_backup_data(state->slot[state->index].b1, 1); watch_store_backup_data(state->slot[state->index].b2, 2); @@ -72,8 +72,7 @@ static void load_saves_to_state(save_load_state_t *state) { } } -void save_load_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void save_load_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(save_load_state_t)); @@ -81,8 +80,7 @@ void save_load_face_setup(movement_settings_t *settings, uint8_t watch_face_inde } } -void save_load_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void save_load_face_activate(void *context) { save_load_state_t *state = (save_load_state_t *)context; state->index = 0; state->update_timeout = 0; @@ -102,7 +100,7 @@ static void update_display(save_load_state_t *state) { } } -bool save_load_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool save_load_face_loop(movement_event_t event, void *context) { save_load_state_t *state = (save_load_state_t *)context; switch (event.event_type) { @@ -127,7 +125,7 @@ bool save_load_face_loop(movement_event_t event, movement_settings_t *settings, break; case EVENT_ALARM_LONG_PRESS: if (state->slot[state->index].version) { - load(state, settings); + load(state); watch_display_string("Loaded", 4); state->update_timeout = 3; } @@ -136,14 +134,13 @@ bool save_load_face_loop(movement_event_t event, movement_settings_t *settings, movement_move_to_face(0); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void save_load_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void save_load_face_resign(void *context) { (void) context; // handle any cleanup before your watch face goes off-screen. diff --git a/movement/watch_faces/settings/save_load_face.h b/movement/watch_faces/settings/save_load_face.h index fc155317..786b5f54 100644 --- a/movement/watch_faces/settings/save_load_face.h +++ b/movement/watch_faces/settings/save_load_face.h @@ -65,10 +65,10 @@ typedef struct { savefile_t slot[SAVE_LOAD_SLOTS]; } save_load_state_t; -void save_load_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void save_load_face_activate(movement_settings_t *settings, void *context); -bool save_load_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void save_load_face_resign(movement_settings_t *settings, void *context); +void save_load_face_setup(uint8_t watch_face_index, void ** context_ptr); +void save_load_face_activate(void *context); +bool save_load_face_loop(movement_event_t event, void *context); +void save_load_face_resign(void *context); #define save_load_face ((const watch_face_t){ \ save_load_face_setup, \ diff --git a/movement/watch_faces/settings/set_time_hackwatch_face.c b/movement/watch_faces/settings/set_time_hackwatch_face.c index c27f4047..d10917a8 100644 --- a/movement/watch_faces/settings/set_time_hackwatch_face.c +++ b/movement/watch_faces/settings/set_time_hackwatch_face.c @@ -34,20 +34,18 @@ char set_time_hackwatch_face_titles[][3] = {"HR", "M1", "SE", "YR", "MO", "DA", watch_date_time date_time_settings; -void set_time_hackwatch_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void set_time_hackwatch_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint8_t)); } -void set_time_hackwatch_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void set_time_hackwatch_face_activate(void *context) { *((uint8_t *)context) = 3; movement_request_tick_frequency(32); date_time_settings = watch_rtc_get_date_time(); } -bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool set_time_hackwatch_face_loop(movement_event_t event, void *context) { uint8_t current_page = *((uint8_t *)context); if (event.subsecond == 15) // Delay displayed time update by ~0.5 seconds, to align phase exactly to main clock at 1Hz @@ -185,7 +183,7 @@ bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *s // don't light up every time light is hit break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } @@ -263,8 +261,7 @@ bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *s return true; } -void set_time_hackwatch_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void set_time_hackwatch_face_resign(void *context) { (void) context; watch_set_led_off(); movement_store_settings(); diff --git a/movement/watch_faces/settings/set_time_hackwatch_face.h b/movement/watch_faces/settings/set_time_hackwatch_face.h index 41b91ac4..ad883a66 100644 --- a/movement/watch_faces/settings/set_time_hackwatch_face.h +++ b/movement/watch_faces/settings/set_time_hackwatch_face.h @@ -50,10 +50,10 @@ #include "movement.h" -void set_time_hackwatch_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void set_time_hackwatch_face_activate(movement_settings_t *settings, void *context); -bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void set_time_hackwatch_face_resign(movement_settings_t *settings, void *context); +void set_time_hackwatch_face_setup(uint8_t watch_face_index, void ** context_ptr); +void set_time_hackwatch_face_activate(void *context); +bool set_time_hackwatch_face_loop(movement_event_t event, void *context); +void set_time_hackwatch_face_resign(void *context); #define set_time_hackwatch_face ((const watch_face_t){ \ set_time_hackwatch_face_setup, \ diff --git a/watch-faces/clock/beats_face.c b/watch-faces/clock/beats_face.c index 9a9ffb94..39e5f6e4 100644 --- a/watch-faces/clock/beats_face.c +++ b/watch-faces/clock/beats_face.c @@ -29,8 +29,7 @@ const uint8_t BEAT_REFRESH_FREQUENCY = 8; -void beats_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void beats_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; (void) context_ptr; if (*context_ptr == NULL) { @@ -38,16 +37,14 @@ void beats_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v } } -void beats_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void beats_face_activate(void *context) { beats_face_state_t *state = (beats_face_state_t *)context; state->next_subsecond_update = 0; state->last_centibeat_displayed = 0; movement_request_tick_frequency(BEAT_REFRESH_FREQUENCY); } -bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool beats_face_loop(movement_event_t event, void *context) { beats_face_state_t *state = (beats_face_state_t *)context; if (event.event_type == EVENT_TICK && event.subsecond != state->next_subsecond_update) { return true; // math is hard, don't do it if we don't have to. @@ -82,15 +79,14 @@ bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void watch_display_text(WATCH_POSITION_FULL, buf); break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void beats_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void beats_face_resign(void *context) { (void) context; } diff --git a/watch-faces/clock/beats_face.h b/watch-faces/clock/beats_face.h index 4a066241..66afdd89 100644 --- a/watch-faces/clock/beats_face.h +++ b/watch-faces/clock/beats_face.h @@ -44,10 +44,10 @@ typedef struct { } beats_face_state_t; uint32_t clock2beats(uint32_t hours, uint32_t minutes, uint32_t seconds, uint32_t subseconds, int16_t utc_offset); -void beats_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void beats_face_activate(movement_settings_t *settings, void *context); -bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void beats_face_resign(movement_settings_t *settings, void *context); +void beats_face_setup(uint8_t watch_face_index, void ** context_ptr); +void beats_face_activate(void *context); +bool beats_face_loop(movement_event_t event, void *context); +void beats_face_resign(void *context); #define beats_face ((const watch_face_t){ \ beats_face_setup, \ diff --git a/watch-faces/clock/clock_face.c b/watch-faces/clock/clock_face.c index 79bcd9be..3943a6a2 100644 --- a/watch-faces/clock/clock_face.c +++ b/watch-faces/clock/clock_face.c @@ -60,7 +60,7 @@ static void clock_indicate(watch_indicator_t indicator, bool on) { } } -static void clock_indicate_alarm(movement_settings_t *settings) { +static void clock_indicate_alarm() { clock_indicate(WATCH_INDICATOR_SIGNAL, movement_alarm_enabled()); } @@ -68,7 +68,7 @@ static void clock_indicate_time_signal(clock_state_t *clock) { clock_indicate(WATCH_INDICATOR_BELL, clock->time_signal_enabled); } -static void clock_indicate_24h(movement_settings_t *settings) { +static void clock_indicate_24h() { clock_indicate(WATCH_INDICATOR_24H, !!movement_clock_mode_24h()); } @@ -76,7 +76,7 @@ static bool clock_is_pm(watch_date_time date_time) { return date_time.unit.hour >= 12; } -static void clock_indicate_pm(movement_settings_t *settings, watch_date_time date_time) { +static void clock_indicate_pm(watch_date_time date_time) { if (movement_clock_mode_24h()) { return; } clock_indicate(WATCH_INDICATOR_PM, clock_is_pm(date_time)); } @@ -166,10 +166,10 @@ static bool clock_display_some(watch_date_time current, watch_date_time previous } } -static void clock_display_clock(movement_settings_t *settings, clock_state_t *clock, watch_date_time current) { +static void clock_display_clock(clock_state_t *clock, watch_date_time current) { if (!clock_display_some(current, clock->date_time.previous)) { if (movement_clock_mode_24h() == MOVEMENT_CLOCK_MODE_12H) { - clock_indicate_pm(settings, current); + clock_indicate_pm(current); current = clock_24h_to_12h(current); } clock_display_all(current, movement_clock_mode_24h() == MOVEMENT_CLOCK_MODE_024H); @@ -204,8 +204,7 @@ static void clock_stop_tick_tock_animation(void) { } } -void clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void clock_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -216,14 +215,14 @@ void clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v } } -void clock_face_activate(movement_settings_t *settings, void *context) { +void clock_face_activate(void *context) { clock_state_t *clock = (clock_state_t *) context; clock_stop_tick_tock_animation(); clock_indicate_time_signal(clock); - clock_indicate_alarm(settings); - clock_indicate_24h(settings); + clock_indicate_alarm(); + clock_indicate_24h(); watch_set_colon(); @@ -231,7 +230,7 @@ void clock_face_activate(movement_settings_t *settings, void *context) { clock->date_time.previous.reg = 0xFFFFFFFF; } -bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool clock_face_loop(movement_event_t event, void *context) { clock_state_t *state = (clock_state_t *) context; watch_date_time current; @@ -244,7 +243,7 @@ bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void case EVENT_ACTIVATE: current = watch_rtc_get_date_time(); - clock_display_clock(settings, state, current); + clock_display_clock(state, current); clock_check_battery_periodically(state, current); @@ -260,19 +259,17 @@ bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void movement_play_signal(); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void clock_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void clock_face_resign(void *context) { (void) context; } -bool clock_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool clock_face_wants_background_task(void *context) { clock_state_t *state = (clock_state_t *) context; if (!state->time_signal_enabled) return false; diff --git a/watch-faces/clock/clock_face.h b/watch-faces/clock/clock_face.h index c4209e3b..864cf7e7 100644 --- a/watch-faces/clock/clock_face.h +++ b/watch-faces/clock/clock_face.h @@ -43,11 +43,11 @@ #include "movement.h" -void clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void clock_face_activate(movement_settings_t *settings, void *context); -bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void clock_face_resign(movement_settings_t *settings, void *context); -bool clock_face_wants_background_task(movement_settings_t *settings, void *context); +void clock_face_setup(uint8_t watch_face_index, void ** context_ptr); +void clock_face_activate(void *context); +bool clock_face_loop(movement_event_t event, void *context); +void clock_face_resign(void *context); +bool clock_face_wants_background_task(void *context); #define clock_face ((const watch_face_t) { \ clock_face_setup, \ diff --git a/watch-faces/clock/simple_clock_face.c b/watch-faces/clock/simple_clock_face.c index 7723d8be..c616c64f 100644 --- a/watch-faces/clock/simple_clock_face.c +++ b/watch-faces/clock/simple_clock_face.c @@ -34,8 +34,7 @@ static void _update_alarm_indicator(bool settings_alarm_enabled, simple_clock_st else watch_clear_indicator(WATCH_INDICATOR_SIGNAL); } -void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void simple_clock_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -46,7 +45,7 @@ void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_i } } -void simple_clock_face_activate(movement_settings_t *settings, void *context) { +void simple_clock_face_activate(void *context) { simple_clock_state_t *state = (simple_clock_state_t *)context; if (watch_tick_animation_is_running()) watch_stop_tick_animation(); @@ -66,7 +65,7 @@ void simple_clock_face_activate(movement_settings_t *settings, void *context) { state->previous_date_time = 0xFFFFFFFF; } -bool simple_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool simple_clock_face_loop(movement_event_t event, void *context) { simple_clock_state_t *state = (simple_clock_state_t *)context; char buf[11]; @@ -143,19 +142,17 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting movement_play_signal(); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -void simple_clock_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void simple_clock_face_resign(void *context) { (void) context; } -bool simple_clock_face_wants_background_task(movement_settings_t *settings, void *context) { - (void) settings; +bool simple_clock_face_wants_background_task(void *context) { simple_clock_state_t *state = (simple_clock_state_t *)context; if (!state->signal_enabled) return false; diff --git a/watch-faces/clock/simple_clock_face.h b/watch-faces/clock/simple_clock_face.h index e74a6e86..ce9aa93e 100644 --- a/watch-faces/clock/simple_clock_face.h +++ b/watch-faces/clock/simple_clock_face.h @@ -45,11 +45,11 @@ typedef struct { bool alarm_enabled; } simple_clock_state_t; -void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void simple_clock_face_activate(movement_settings_t *settings, void *context); -bool simple_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void simple_clock_face_resign(movement_settings_t *settings, void *context); -bool simple_clock_face_wants_background_task(movement_settings_t *settings, void *context); +void simple_clock_face_setup(uint8_t watch_face_index, void ** context_ptr); +void simple_clock_face_activate(void *context); +bool simple_clock_face_loop(movement_event_t event, void *context); +void simple_clock_face_resign(void *context); +bool simple_clock_face_wants_background_task(void *context); #define simple_clock_face ((const watch_face_t){ \ simple_clock_face_setup, \ diff --git a/watch-faces/clock/world_clock_face.c b/watch-faces/clock/world_clock_face.c index ddbcc94e..28adb4d5 100644 --- a/watch-faces/clock/world_clock_face.c +++ b/watch-faces/clock/world_clock_face.c @@ -35,8 +35,7 @@ void _update_timezone_offset(world_clock_state_t *state) { state->current_offset = movement_get_current_timezone_offset_for_zone(state->settings.bit.timezone_index); } -void world_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void world_clock_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(world_clock_state_t)); @@ -51,8 +50,7 @@ void world_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_in } } -void world_clock_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void world_clock_face_activate(void *context) { world_clock_state_t *state = (world_clock_state_t *)context; state->current_screen = 0; @@ -61,7 +59,7 @@ void world_clock_face_activate(movement_settings_t *settings, void *context) { if (watch_tick_animation_is_running()) watch_stop_tick_animation(); } -static bool world_clock_face_do_display_mode(movement_event_t event, movement_settings_t *settings, world_clock_state_t *state) { +static bool world_clock_face_do_display_mode(movement_event_t event, world_clock_state_t *state) { char buf[11]; uint32_t previous_date_time; @@ -121,13 +119,13 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se state->current_screen = 1; break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } return true; } -static bool _world_clock_face_do_settings_mode(movement_event_t event, movement_settings_t *settings, world_clock_state_t *state) { +static bool _world_clock_face_do_settings_mode(movement_event_t event, world_clock_state_t *state) { switch (event.event_type) { case EVENT_MODE_BUTTON_UP: if (state->backup_register) watch_store_backup_data(state->settings.reg, state->backup_register); @@ -141,7 +139,7 @@ static bool _world_clock_face_do_settings_mode(movement_event_t event, movement_ state->current_screen = 0; if (state->backup_register) watch_store_backup_data(state->settings.reg, state->backup_register); event.event_type = EVENT_ACTIVATE; - return world_clock_face_do_display_mode(event, settings, state); + return world_clock_face_do_display_mode(event, state); } break; case EVENT_ALARM_BUTTON_DOWN: @@ -198,17 +196,16 @@ static bool _world_clock_face_do_settings_mode(movement_event_t event, movement_ return true; } -bool world_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool world_clock_face_loop(movement_event_t event, void *context) { world_clock_state_t *state = (world_clock_state_t *)context; if (state->current_screen == 0) { - return world_clock_face_do_display_mode(event, settings, state); + return world_clock_face_do_display_mode(event, state); } else { - return _world_clock_face_do_settings_mode(event, settings, state); + return _world_clock_face_do_settings_mode(event, state); } } -void world_clock_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void world_clock_face_resign(void *context) { (void) context; } diff --git a/watch-faces/clock/world_clock_face.h b/watch-faces/clock/world_clock_face.h index bca82cd9..7cb1b252 100644 --- a/watch-faces/clock/world_clock_face.h +++ b/watch-faces/clock/world_clock_face.h @@ -65,10 +65,10 @@ typedef struct { int32_t current_offset; } world_clock_state_t; -void world_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void world_clock_face_activate(movement_settings_t *settings, void *context); -bool world_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void world_clock_face_resign(movement_settings_t *settings, void *context); +void world_clock_face_setup(uint8_t watch_face_index, void ** context_ptr); +void world_clock_face_activate(void *context); +bool world_clock_face_loop(movement_event_t event, void *context); +void world_clock_face_resign(void *context); uint8_t world_clock_face_get_weekday(uint16_t day, uint16_t month, uint16_t year); diff --git a/watch-faces/complication/countdown_face.c b/watch-faces/complication/countdown_face.c index 781481df..2ef3ef97 100644 --- a/watch-faces/complication/countdown_face.c +++ b/watch-faces/complication/countdown_face.c @@ -59,14 +59,13 @@ static inline void load_countdown(countdown_state_t *state) { state->seconds = state->set_seconds; } -static inline void button_beep(movement_settings_t *settings) { +static inline void button_beep() { // play a beep as confirmation for a button press (if applicable) if (movement_button_should_sound()) watch_buzzer_play_note(BUZZER_NOTE_C7, 50); } -static void schedule_countdown(countdown_state_t *state, movement_settings_t *settings) { - (void) settings; +static void schedule_countdown(countdown_state_t *state) { // Calculate the new state->now_ts but don't update it until we've updated the target - // avoid possible race where the old target is compared to the new time and immediately triggers @@ -77,15 +76,15 @@ static void schedule_countdown(countdown_state_t *state, movement_settings_t *se movement_schedule_background_task_for_face(state->watch_face_index, target_dt); } -static void auto_repeat(countdown_state_t *state, movement_settings_t *settings) { +static void auto_repeat(countdown_state_t *state) { movement_play_alarm(); load_countdown(state); - schedule_countdown(state, settings); + schedule_countdown(state); } -static void start(countdown_state_t *state, movement_settings_t *settings) { +static void start(countdown_state_t *state) { state->mode = cd_running; - schedule_countdown(state, settings); + schedule_countdown(state); } @@ -153,9 +152,9 @@ static void ring(countdown_state_t *state) { reset(state); } -static void times_up(movement_settings_t *settings, countdown_state_t *state) { +static void times_up(countdown_state_t *state) { if(state->repeat) { - auto_repeat(state, settings); + auto_repeat(state); } else { ring(state); @@ -180,8 +179,7 @@ static void settings_increment(countdown_state_t *state) { return; } -void countdown_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void countdown_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { @@ -195,8 +193,7 @@ void countdown_face_setup(movement_settings_t *settings, uint8_t watch_face_inde } } -void countdown_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void countdown_face_activate(void *context) { countdown_state_t *state = (countdown_state_t *)context; if(state->mode == cd_running) { watch_date_time now = watch_rtc_get_date_time(); @@ -211,8 +208,7 @@ void countdown_face_activate(movement_settings_t *settings, void *context) { quick_ticks_running = false; } -bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { - (void) settings; +bool countdown_face_loop(movement_event_t event, void *context) { countdown_state_t *state = (countdown_state_t *)context; switch (event.event_type) { @@ -244,7 +240,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, break; case cd_paused: reset(state); - button_beep(settings); + button_beep(); break; case cd_setting: state->selection++; @@ -253,7 +249,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, state->mode = cd_reset; store_countdown(state); movement_request_tick_frequency(1); - button_beep(settings); + button_beep(); } break; } @@ -263,14 +259,14 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, switch(state->mode) { case cd_running: pause(state); - button_beep(settings); + button_beep(); break; case cd_reset: case cd_paused: if (!(state->hours == 0 && state->minutes == 0 && state->seconds == 0)) { // Only start the timer if we have a valid time. - start(state, settings); - button_beep(settings); + start(state); + button_beep(); watch_set_indicator(WATCH_INDICATOR_SIGNAL); } break; @@ -286,7 +282,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, // long press in reset mode enters settings state->mode = cd_setting; movement_request_tick_frequency(4); - button_beep(settings); + button_beep(); break; case cd_setting: // long press in settings mode starts quick ticks for adjusting the time @@ -314,7 +310,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, } } else { // Toggle auto-repeat - button_beep(settings); + button_beep(); state->repeat = !state->repeat; if(state->repeat) watch_set_indicator(WATCH_INDICATOR_BELL); @@ -326,7 +322,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, abort_quick_ticks(state); break; case EVENT_BACKGROUND_TASK: - times_up(settings, state); + times_up(state); break; case EVENT_TIMEOUT: if (state->mode == cd_setting) { @@ -334,7 +330,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, state->mode = cd_reset; store_countdown(state); movement_request_tick_frequency(1); - button_beep(settings); + button_beep(); } break; case EVENT_LOW_ENERGY_UPDATE: @@ -342,15 +338,14 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, // intentionally squelch the light default event; we only show the light when cd is running or reset break; default: - movement_default_loop_handler(event, settings); + movement_default_loop_handler(event); break; } return true; } -void countdown_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void countdown_face_resign(void *context) { countdown_state_t *state = (countdown_state_t *)context; if (state->mode == cd_setting) { state->selection = 0; diff --git a/watch-faces/complication/countdown_face.h b/watch-faces/complication/countdown_face.h index 0f9cd8d4..dc8b1bfc 100644 --- a/watch-faces/complication/countdown_face.h +++ b/watch-faces/complication/countdown_face.h @@ -67,10 +67,10 @@ typedef struct { } countdown_state_t; -void countdown_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void countdown_face_activate(movement_settings_t *settings, void *context); -bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void countdown_face_resign(movement_settings_t *settings, void *context); +void countdown_face_setup(uint8_t watch_face_index, void ** context_ptr); +void countdown_face_activate(void *context); +bool countdown_face_loop(movement_event_t event, void *context); +void countdown_face_resign(void *context); #define countdown_face ((const watch_face_t){ \ countdown_face_setup, \ diff --git a/watch-faces/settings/preferences_face.c b/watch-faces/settings/preferences_face.c index 8fc1466e..53237cb9 100644 --- a/watch-faces/settings/preferences_face.c +++ b/watch-faces/settings/preferences_face.c @@ -37,8 +37,7 @@ const char preferences_face_titles[PREFERENCES_PAGE_NUM_PREFERENCES][11] = { "LT blue ", // Light: blue component (for watches with blue LED) }; -void preferences_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void preferences_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) { *context_ptr = malloc(sizeof(preferences_state_t)); @@ -62,14 +61,13 @@ void preferences_face_setup(movement_settings_t *settings, uint8_t watch_face_in } } -void preferences_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void preferences_face_activate(void *context) { preferences_state_t *state = (preferences_state_t *)context; state->current_page = 0; movement_request_tick_frequency(4); // we need to manually blink some pixels } -bool preferences_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool preferences_face_loop(movement_event_t event, void *context) { preferences_state_t *state = (preferences_state_t *)context; movement_color_t color; // to use in the switch if we need it @@ -225,7 +223,7 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings movement_move_to_face(0); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } if (state->current_page == PREFERENCES_PAGE_LED_RED || @@ -243,8 +241,7 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings } } -void preferences_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void preferences_face_resign(void *context) { (void) context; movement_force_led_off(); movement_store_settings(); diff --git a/watch-faces/settings/preferences_face.h b/watch-faces/settings/preferences_face.h index c9ab68f6..7b085d86 100644 --- a/watch-faces/settings/preferences_face.h +++ b/watch-faces/settings/preferences_face.h @@ -99,10 +99,10 @@ typedef struct { preferences_page_t current_page; } preferences_state_t; -void preferences_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void preferences_face_activate(movement_settings_t *settings, void *context); -bool preferences_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void preferences_face_resign(movement_settings_t *settings, void *context); +void preferences_face_setup(uint8_t watch_face_index, void ** context_ptr); +void preferences_face_activate(void *context); +bool preferences_face_loop(movement_event_t event, void *context); +void preferences_face_resign(void *context); #define preferences_face ((const watch_face_t){ \ preferences_face_setup, \ diff --git a/watch-faces/settings/set_time_face.c b/watch-faces/settings/set_time_face.c index 312a886f..ff7f46ba 100644 --- a/watch-faces/settings/set_time_face.c +++ b/watch-faces/settings/set_time_face.c @@ -34,7 +34,7 @@ const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "S static bool _quick_ticks_running; -static void _handle_alarm_button(movement_settings_t *settings, watch_date_time date_time, uint8_t current_page) { +static void _handle_alarm_button(watch_date_time date_time, uint8_t current_page) { // handles short or long pressing of the alarm button switch (current_page) { @@ -74,27 +74,25 @@ static void _abort_quick_ticks() { } } -void set_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) { - (void) settings; +void set_time_face_setup(uint8_t watch_face_index, void ** context_ptr) { (void) watch_face_index; if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint8_t)); } -void set_time_face_activate(movement_settings_t *settings, void *context) { - (void) settings; +void set_time_face_activate(void *context) { *((uint8_t *)context) = 0; movement_request_tick_frequency(4); _quick_ticks_running = false; } -bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { +bool set_time_face_loop(movement_event_t event, void *context) { uint8_t current_page = *((uint8_t *)context); watch_date_time date_time = watch_rtc_get_date_time(); switch (event.event_type) { case EVENT_TICK: if (_quick_ticks_running) { - if (HAL_GPIO_BTN_ALARM_read()) _handle_alarm_button(settings, date_time, current_page); + if (HAL_GPIO_BTN_ALARM_read()) _handle_alarm_button(date_time, current_page); else _abort_quick_ticks(); } break; @@ -117,14 +115,14 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v break; case EVENT_ALARM_BUTTON_UP: _abort_quick_ticks(); - _handle_alarm_button(settings, date_time, current_page); + _handle_alarm_button(date_time, current_page); break; case EVENT_TIMEOUT: _abort_quick_ticks(); movement_move_to_face(0); break; default: - return movement_default_loop_handler(event, settings); + return movement_default_loop_handler(event); } char buf[11]; @@ -178,8 +176,7 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v return true; } -void set_time_face_resign(movement_settings_t *settings, void *context) { - (void) settings; +void set_time_face_resign(void *context) { (void) context; watch_set_led_off(); movement_store_settings(); diff --git a/watch-faces/settings/set_time_face.h b/watch-faces/settings/set_time_face.h index f66dc9e4..7f2c2631 100644 --- a/watch-faces/settings/set_time_face.h +++ b/watch-faces/settings/set_time_face.h @@ -44,10 +44,10 @@ #include "movement.h" -void set_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); -void set_time_face_activate(movement_settings_t *settings, void *context); -bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context); -void set_time_face_resign(movement_settings_t *settings, void *context); +void set_time_face_setup(uint8_t watch_face_index, void ** context_ptr); +void set_time_face_activate(void *context); +bool set_time_face_loop(movement_event_t event, void *context); +void set_time_face_resign(void *context); #define set_time_face ((const watch_face_t){ \ set_time_face_setup, \