Skip to content

Commit

Permalink
faces/simple_clock: clear segments if not 024h
Browse files Browse the repository at this point in the history
Ensure that the segments of the leading hour digit are cleared
prior to displaying the time when the watch is not in 024h mode.
This prevents a previous configuration from putting the display
in an inconsistent state where the watch is configured to show
the time in 12h or 24h modes but the leading zero is still shown.

Reported-by: CarpeNoctem <[email protected]>
GitHub-Issue: #476
  • Loading branch information
matheusmoreira committed Sep 16, 2024
1 parent 831aadd commit bd4fbd4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion movement/watch_faces/clock/simple_clock_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,13 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
}
}
watch_display_string(buf, pos);
if (set_leading_zero)

if (set_leading_zero) {
watch_display_string("0", 4);
} else {
watch_display_string(" ", 4);
}

// handle alarm indicator
if (state->alarm_enabled != settings->bit.alarm_enabled) _update_alarm_indicator(settings->bit.alarm_enabled, state);
break;
Expand Down

0 comments on commit bd4fbd4

Please sign in to comment.