Return to clock mode on inactivity timeout in settings

_settings_loop() never handled EVENT_TIMEOUT, so leaving the watch
face parked in settings mode (4Hz tick, blinking abbreviation) with
no button presses meant it stayed there indefinitely instead of
returning to the clock display like every other face's settings mode
does on timeout.

Factor the existing EVENT_MODE_BUTTON_UP transition logic into
_exit_settings_mode() and reuse it for EVENT_TIMEOUT.
This commit is contained in:
Konrad Rieck
2026-07-27 22:34:04 +02:00
parent cd18c95779
commit 0557684ec1
+19 -10
View File
@@ -321,6 +321,21 @@ static bool _clock_loop(movement_event_t event, world_clock2_state_t *state)
return true;
}
/* Leave settings mode and return to the clock display */
static void _exit_settings_mode(movement_event_t event, world_clock2_state_t *state)
{
/* Find next selected zone */
if (!state->zones[state->current_zone].selected)
state->current_zone = _next_selected_zone(state, FORWARD);
/* Switch to display mode */
state->current_mode = WORLD_CLOCK2_MODE_CLOCK;
state->show_zone_name = NAME_DISPLAY_TIME;
refresh_face = true;
movement_request_tick_frequency(1);
_clock_display(event, state);
}
static bool _settings_loop(movement_event_t event, world_clock2_state_t *state)
{
uint8_t zone;
@@ -358,18 +373,12 @@ static bool _settings_loop(movement_event_t event, world_clock2_state_t *state)
_settings_display(event, state);
break;
case EVENT_MODE_BUTTON_UP:
/* Find next selected zone */
if (!state->zones[state->current_zone].selected)
state->current_zone = _next_selected_zone(state, FORWARD);
/* Switch to display mode */
state->current_mode = WORLD_CLOCK2_MODE_CLOCK;
state->show_zone_name = NAME_DISPLAY_TIME;
refresh_face = true;
movement_request_tick_frequency(1);
_clock_display(event, state);
_exit_settings_mode(event, state);
_beep(BEEP_BUTTON);
break;
case EVENT_TIMEOUT:
_exit_settings_mode(event, state);
break;
default:
return movement_default_loop_handler(event);
}