summaryrefslogtreecommitdiffstats
path: root/movement/watch_faces/clock
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-04-10 15:18:36 -0400
committerJoey Castillo <joeycastillo@utexas.edu>2022-04-10 15:18:36 -0400
commit35172ce11a184daf409f8d6c03c6844cc5382b71 (patch)
tree80054a89e778f3b4226f1dff366fde1baa584e9d /movement/watch_faces/clock
parent405f010ade01fc337e9dbf9728260783ad62f4a3 (diff)
downloadSensor-Watch-35172ce11a184daf409f8d6c03c6844cc5382b71.tar.gz
Sensor-Watch-35172ce11a184daf409f8d6c03c6844cc5382b71.tar.bz2
Sensor-Watch-35172ce11a184daf409f8d6c03c6844cc5382b71.zip
world clock: fix glitch when exiting settings mode
Diffstat (limited to 'movement/watch_faces/clock')
-rw-r--r--movement/watch_faces/clock/world_clock_face.c13
1 files changed, 7 insertions, 6 deletions
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: