Support leading zero representation for 24h clock

Toggle between default behavior and leading zero with long-press of alarm
button on page with 24h setting.
This commit is contained in:
Jonathan Glines
2023-09-24 14:00:13 -04:00
parent 5c94111ea2
commit f633b7634b
18 changed files with 132 additions and 31 deletions

View File

@@ -50,12 +50,15 @@ void _wake_face_update_display(movement_settings_t *settings, wake_face_state_t
uint8_t hour = state->hour;
watch_clear_display();
if ( settings->bit.clock_mode_24h )
watch_set_indicator(WATCH_INDICATOR_24H);
else {
bool set_leading_zero = false;
if ( !settings->bit.clock_mode_24h ) {
if ( hour >= 12 )
watch_set_indicator(WATCH_INDICATOR_PM);
hour = hour % 12 ? hour % 12 : 12;
} else if ( !settings->bit.clock_24h_leading_zero ) {
watch_set_indicator(WATCH_INDICATOR_24H);
} else if ( hour < 10 ) {
set_leading_zero = true;
}
if ( state->mode )
@@ -66,6 +69,8 @@ void _wake_face_update_display(movement_settings_t *settings, wake_face_state_t
watch_set_colon();
watch_display_string(lcdbuf, 0);
if ( set_leading_zero )
watch_display_string("0", 4);
}
//