From 35172ce11a184daf409f8d6c03c6844cc5382b71 Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Sun, 10 Apr 2022 15:18:36 -0400 Subject: world clock: fix glitch when exiting settings mode --- movement/watch_faces/clock/world_clock_face.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'movement/watch_faces') diff --git a/movement/watch_faces/clock/world_clock_face.c b/movement/watch_faces/clock/world_clock_face.c index 1d09a4c0..4004bab2 100644 --- a/movement/watch_faces/clock/world_clock_face.c +++ b/movement/watch_faces/clock/world_clock_face.c @@ -44,14 +44,11 @@ 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; world_clock_state_t *state = (world_clock_state_t *)context; state->current_screen = 0; - state->previous_date_time = 0xFFFFFFFF; if (watch_tick_animation_is_running()) watch_stop_tick_animation(); - if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); - - watch_set_colon(); } static bool world_clock_face_do_display_mode(movement_event_t event, movement_settings_t *settings, world_clock_state_t *state) { @@ -63,6 +60,10 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se watch_date_time date_time; switch (event.event_type) { case EVENT_ACTIVATE: + if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H); + watch_set_colon(); + state->previous_date_time = 0xFFFFFFFF; + // fall through case EVENT_TICK: case EVENT_LOW_ENERGY_UPDATE: date_time = watch_rtc_get_date_time(); @@ -140,9 +141,9 @@ static bool _world_clock_face_do_settings_mode(movement_event_t event, movement_ if (state->current_screen > 3) { movement_request_tick_frequency(1); state->current_screen = 0; - state->previous_date_time = 0xFFFFFFFF; if (state->backup_register) watch_store_backup_data(state->settings.reg, state->backup_register); - world_clock_face_do_display_mode(event, settings, state); + event.event_type = EVENT_ACTIVATE; + return world_clock_face_do_display_mode(event, settings, state); } break; case EVENT_ALARM_BUTTON_DOWN: -- cgit v1.2.3