Skip to content

Commit 58e2a08

Browse files
faces/clock: clear segments if not in 024h mode
There was an issue where the clock's display would remain in 024h mode even after switching back to 12h/24h mode because it only took into account the leading zero bit, whose value is meaningless unless the 24h mode bit is also set. The issue is fixed by taking both bits into account. Closes #476. Reported-by: CarpeNoctem <cryptomax@pm.me> GitHub-Issue: #476
1 parent 41e9273 commit 58e2a08

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

movement/watch_faces/clock/clock_face.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ static bool clock_is_in_24h_mode(movement_settings_t *settings) {
6060
#endif
6161
}
6262

63+
static bool clock_should_set_leading_zero(movement_settings_t *settings) {
64+
return clock_is_in_24h_mode(settings) && settings->bit.clock_24h_leading_zero;
65+
}
66+
6367
static void clock_indicate(WatchIndicatorSegment indicator, bool on) {
6468
if (on) {
6569
watch_set_indicator(indicator);
@@ -180,7 +184,7 @@ static void clock_display_clock(movement_settings_t *settings, clock_state_t *cl
180184
clock_indicate_pm(settings, current);
181185
current = clock_24h_to_12h(current);
182186
}
183-
clock_display_all(current, settings->bit.clock_24h_leading_zero);
187+
clock_display_all(current, clock_should_set_leading_zero(settings));
184188
}
185189
}
186190

0 commit comments

Comments
 (0)