Merge PR #299 - leading zero representation

Adds a movement-wide leading zero 024h representation mode
that's toggleable in the preferences watch face.
Also adds support for the new display mode to existing faces.

I modified the logic a bit to ensure the 24h indicator remains lit
in the simple clock face even when in 024h mode. I also added support
to the more advanced clock face. In the future I will add a compile time
toggle to it as well.

Reviewed-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
GitHub-Pull-Request: https://github.com/joeycastillo/Sensor-Watch/pull/299
This commit is contained in:
Matheus Afonso Martins Moreira
2024-09-03 18:49:13 -03:00
19 changed files with 137 additions and 33 deletions

View File

@@ -38,12 +38,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 )
@@ -54,6 +57,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);
}
//