]> git.earman.xyz Git - sensor-watch.git/commitdiff
Revert "Support leading zero representation for 24h clock"
authorjoeycastillo <joeycastillo@utexas.edu>
Thu, 19 Sep 2024 03:28:26 +0000 (23:28 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Thu, 19 Sep 2024 03:34:02 +0000 (23:34 -0400)
This reverts commit f633b7634b80d0bf08e491606eab3f10f85d6ece.

18 files changed:
movement.h
movement/watch_faces/clock/repetition_minute_face.c
movement/watch_faces/clock/simple_clock_bin_led_face.c
movement/watch_faces/clock/weeknumber_clock_face.c
movement/watch_faces/clock/world_clock2_face.c
movement/watch_faces/clock/world_clock_face.c
movement/watch_faces/complication/activity_face.c
movement/watch_faces/complication/alarm_face.c
movement/watch_faces/complication/planetary_hours_face.c
movement/watch_faces/complication/planetary_time_face.c
movement/watch_faces/complication/sunrise_sunset_face.c
movement/watch_faces/complication/wake_face.c
movement/watch_faces/demo/lis2dw_logging_face.c
movement/watch_faces/sensor/thermistor_logging_face.c
movement/watch_faces/settings/preferences_face.c
movement/watch_faces/settings/set_time_hackwatch_face.c
watch-faces/clock/simple_clock_face.c
watch-faces/settings/set_time_face.c

index 10ef44d4e697210a34bcddde84e9d0841dd92adc..2dd53ee60d11fe2151996ead90b740d7c1f2976e 100644 (file)
@@ -60,10 +60,9 @@ typedef union {
         // time-oriented complication like a sunrise/sunset timer, and a simple locale preference could tell an
         // altimeter to display feet or meters as easily as it tells a thermometer to display degrees in F or C.
         bool clock_mode_24h : 1;            // indicates whether clock should use 12 or 24 hour mode.
-        bool clock_24h_leading_zero : 1;    // indicates whether clock should leading zero to indicate 24 hour mode.
         bool use_imperial_units : 1;        // indicates whether to use metric units (the default) or imperial.
         bool alarm_enabled : 1;             // indicates whether there is at least one alarm enabled.
-        uint8_t reserved : 5;               // room for more preferences if needed.
+        uint8_t reserved : 6;               // room for more preferences if needed.
     } bit;
     uint32_t reg;
 } movement_settings_t;
index 71a1f78b6486496de724f3ca7b4a8969feeb0610..e9e5e3197507fd99296498205f063da1c8249482 100644 (file)
@@ -68,7 +68,7 @@ void repetition_minute_face_activate(movement_settings_t *settings, void *contex
 
     if (watch_tick_animation_is_running()) watch_stop_tick_animation();
 
-    if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
+    if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
 
     // handle chime indicator
     if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL);
@@ -112,7 +112,6 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se
             // ...and set the LAP indicator if low.
             if (state->battery_low) watch_set_indicator(WATCH_INDICATOR_LAP);
 
-            bool set_leading_zero = false;
             if ((date_time.reg >> 6) == (previous_date_time >> 6) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
                 // everything before seconds is the same, don't waste cycles setting those segments.
                 watch_display_character_lp_seconds('0' + date_time.unit.second / 10, 8);
@@ -133,8 +132,6 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se
                     }
                     date_time.unit.hour %= 12;
                     if (date_time.unit.hour == 0) date_time.unit.hour = 12;
-                } else if (settings->bit.clock_24h_leading_zero && date_time.unit.hour < 10) {
-                    set_leading_zero = true;
                 }
                 pos = 0;
                 if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
@@ -145,8 +142,6 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se
                 }
             }
             watch_display_string(buf, pos);
-            if (set_leading_zero)
-                watch_display_string("0", 4);
             // handle alarm indicator
             if (state->alarm_enabled != settings->bit.alarm_enabled) _update_alarm_indicator(settings->bit.alarm_enabled, state);
             break;
index 371f1e1a27db0650e760feb132e44eacaa647f87..cf39c1886bb8aa8908a2a47b91a494f9a967e2bf 100644 (file)
@@ -60,7 +60,7 @@ void simple_clock_bin_led_face_activate(movement_settings_t *settings, void *con
 
     if (watch_tick_animation_is_running()) watch_stop_tick_animation();
 
-    if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
+    if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
 
     // handle chime indicator
     if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL);
@@ -138,7 +138,6 @@ bool simple_clock_bin_led_face_loop(movement_event_t event, movement_settings_t
                 // ...and set the LAP indicator if low.
                 if (state->battery_low) watch_set_indicator(WATCH_INDICATOR_LAP);
 
-                bool set_leading_zero = false;
                 if ((date_time.reg >> 6) == (previous_date_time >> 6) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
                     // everything before seconds is the same, don't waste cycles setting those segments.
                     watch_display_character_lp_seconds('0' + date_time.unit.second / 10, 8);
@@ -159,8 +158,6 @@ bool simple_clock_bin_led_face_loop(movement_event_t event, movement_settings_t
                         }
                         date_time.unit.hour %= 12;
                         if (date_time.unit.hour == 0) date_time.unit.hour = 12;
-                    } else if (settings->bit.clock_24h_leading_zero && date_time.unit.hour < 10) {
-                        set_leading_zero = true;
                     }
                     pos = 0;
                     if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
@@ -171,8 +168,6 @@ bool simple_clock_bin_led_face_loop(movement_event_t event, movement_settings_t
                     }
                 }
                 watch_display_string(buf, pos);
-                if (set_leading_zero)
-                    watch_display_string("0", 4);
                 // handle alarm indicator
                 if (state->alarm_enabled != settings->bit.alarm_enabled) _update_alarm_indicator(settings->bit.alarm_enabled, state);
             }
index ed694e6fb46f55226e7f9f06321faa67c3f65261..81df58475ba962dcea335112280e891d76927f7e 100644 (file)
@@ -50,7 +50,7 @@ void weeknumber_clock_face_activate(movement_settings_t *settings, void *context
 
     if (watch_tick_animation_is_running()) watch_stop_tick_animation();
 
-    if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
+    if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
 
     // handle chime indicator
     if (state->signal_enabled) watch_set_indicator(WATCH_INDICATOR_BELL);
@@ -94,7 +94,6 @@ bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *set
             // ...and set the LAP indicator if low.
             if (state->battery_low) watch_set_indicator(WATCH_INDICATOR_LAP);
 
-            bool set_leading_zero = false;
             if ((date_time.reg >> 12) == (previous_date_time >> 12) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
                 // everything before minutes is the same.
                 pos = 6;
@@ -110,8 +109,6 @@ bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *set
                     }
                     date_time.unit.hour %= 12;
                     if (date_time.unit.hour == 0) date_time.unit.hour = 12;
-                } else if (settings->bit.clock_24h_leading_zero && date_time.unit.hour < 10) {
-                    set_leading_zero = true;
                 }
                 pos = 0;
                 if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
@@ -122,8 +119,6 @@ bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *set
                 }
             }
             watch_display_string(buf, pos);
-            if (set_leading_zero)
-                watch_display_string("0", 4);
             // handle alarm indicator
             if (state->alarm_enabled != settings->bit.alarm_enabled) _update_alarm_indicator(settings->bit.alarm_enabled, state);
             break;
index 5b3f8a9f34c6272ecdf84d486309892f350c607b..2e1e96950fa6d1666c845a637553f4856fe3186b 100644 (file)
@@ -174,7 +174,7 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings,
            if (refresh_face) {
                watch_clear_indicator(WATCH_INDICATOR_SIGNAL);
                watch_set_colon();
-                if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero)
+                if (settings->bit.clock_mode_24h)
                     watch_set_indicator(WATCH_INDICATOR_24H);
 
                 state->previous_date_time = REFRESH_TIME;
@@ -188,7 +188,6 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings,
            previous_date_time = state->previous_date_time;
            state->previous_date_time = date_time.reg;
 
-            bool set_leading_zero = false;
            if ((date_time.reg >> 6) == (previous_date_time >> 6) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
                 /* Everything before seconds is the same, don't waste cycles setting those segments. */
                pos = 8;
@@ -209,9 +208,7 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings,
                    date_time.unit.hour %= 12;
                    if (date_time.unit.hour == 0)
                        date_time.unit.hour = 12;
-                } else if (settings->bit.clock_24h_leading_zero && date_time.unit.hour < 10) {
-                    set_leading_zero = true;
-                }
+               }
 
                pos = 0;
                if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
@@ -233,8 +230,6 @@ static bool mode_display(movement_event_t event, movement_settings_t *settings,
                }
            }
            watch_display_string(buf, pos);
-            if (set_leading_zero)
-                watch_display_string("0", 4);
            break;
        case EVENT_ALARM_BUTTON_UP:
            state->current_zone = find_selected_zone(state, FORWARD);
index 6b731e8e015bffb1dda06d33c5a6592d878f61c3..b12d9cdf223a1888b04775c57d791cf1459ecf3e 100644 (file)
@@ -60,7 +60,7 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se
     watch_date_time date_time;
     switch (event.event_type) {
         case EVENT_ACTIVATE:
-            if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
+            if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
             watch_set_colon();
             state->previous_date_time = 0xFFFFFFFF;
             // fall through
@@ -72,7 +72,6 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se
             previous_date_time = state->previous_date_time;
             state->previous_date_time = date_time.reg;
 
-            bool set_leading_zero = false;
             if ((date_time.reg >> 6) == (previous_date_time >> 6) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
                 // everything before seconds is the same, don't waste cycles setting those segments.
                 pos = 8;
@@ -92,8 +91,6 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se
                     }
                     date_time.unit.hour %= 12;
                     if (date_time.unit.hour == 0) date_time.unit.hour = 12;
-                } else if (settings->bit.clock_24h_leading_zero && date_time.unit.hour < 10) {
-                    set_leading_zero = true;
                 }
                 pos = 0;
                 if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
@@ -115,8 +112,6 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se
                 }
             }
             watch_display_string(buf, pos);
-            if (set_leading_zero)
-                watch_display_string("0", 4);
             break;
         case EVENT_ALARM_LONG_PRESS:
             movement_request_tick_frequency(4);
index b26fbeb0a54b64926a7927e5ed31bc94e92b7b6b..f92984cd9f6f29ca6eb64db5970fa30c534aa266 100644 (file)
@@ -293,7 +293,6 @@ static void _activity_update_logging_screen(movement_settings_t *settings, activ
     }
     // Briefly, show time without seconds
     else {
-        bool set_leading_zero = false;
         watch_clear_indicator(WATCH_INDICATOR_LAP);
         watch_date_time now = watch_rtc_get_date_time();
         uint8_t hour = now.unit.hour;
@@ -305,18 +304,14 @@ static void _activity_update_logging_screen(movement_settings_t *settings, activ
                 watch_set_indicator(WATCH_INDICATOR_PM);
             hour %= 12;
             if (hour == 0) hour = 12;
-        } else {
+        }
+        else {
+            watch_set_indicator(WATCH_INDICATOR_24H);
             watch_clear_indicator(WATCH_INDICATOR_PM);
-            if (!settings->bit.clock_24h_leading_zero)
-                watch_set_indicator(WATCH_INDICATOR_24H);
-            else if (hour < 10)
-                set_leading_zero = true;
         }
         sprintf(activity_buf, "%2d%02d  ", hour, now.unit.minute);
         watch_set_colon();
         watch_display_string(activity_buf, 4);
-        if (set_leading_zero)
-            watch_display_string("0", 4);
     }
 }
 
index d71ea2036cb67e84b874afe6ee61c091aa16e8cb..0340c08df99e6c14a693d679d3928f19d1eb7774 100644 (file)
@@ -72,7 +72,6 @@ static void _alarm_face_draw(movement_settings_t *settings, alarm_state_t *state
         i = state->alarm[state->alarm_idx].day + 1;
     }
     //handle am/pm for hour display
-    bool set_leading_zero = false;
     uint8_t h = state->alarm[state->alarm_idx].hour;
     if (!settings->bit.clock_mode_24h) {
         if (h >= 12) {
@@ -84,12 +83,6 @@ static void _alarm_face_draw(movement_settings_t *settings, alarm_state_t *state
         if (h == 0) h = 12;
     } else {
         watch_set_indicator(WATCH_INDICATOR_24H);
-
-        if (settings->bit.clock_24h_leading_zero) {
-            if (h < 10) {
-                set_leading_zero = true;
-            }
-        }
     }
 
     sprintf(buf, set_leading_zero? "%c%c%2d%02d%02d  " : "%c%c%2d%2d%02d  ",
index e13466b120cd5cfd9685540d08d04594731c8537..acded9175a6276de8e25a99c3ce7670097520cb6 100644 (file)
@@ -228,7 +228,6 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat
     uint8_t weekday, planet, planetary_hour;
     uint32_t current_hour_epoch;
     watch_date_time scratch_time;
-    bool set_leading_zero = false;
 
     // check if we have a location. If not, display error
     if ( state->no_location ) {
@@ -254,7 +253,7 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat
         return;
     }
 
-    if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
+    if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
 
     // roll over hour iterator
     if ( state->hour < 0 ) state->hour = 23;
@@ -314,8 +313,6 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat
         }
         scratch_time.unit.hour %= 12;
         if (scratch_time.unit.hour == 0) scratch_time.unit.hour = 12;
-    } else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
-        set_leading_zero = true;
     }
     
     // planetary ruler of the hour
@@ -331,8 +328,6 @@ static void _planetary_hours(movement_settings_t *settings, planetary_hours_stat
 
     watch_set_colon();
     watch_display_string(buf, 0);
-    if (set_leading_zero)
-        watch_display_string("0", 4);
 
     if ( state->ruler == 2 ) _planetary_icon(planet);
 }
index 7e7ac6c7db1faede660dcf53b9b6ebf330addc91..56a18cf2289aa7b734d2fbd781e0f638b41cfb79 100644 (file)
@@ -206,7 +206,6 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting
     double night_hour_count = 0.0;
     uint8_t weekday, planet, planetary_hour;
     double hour_duration, current_hour, current_minute, current_second;
-    bool set_leading_zero = false;
 
         watch_set_colon();
 
@@ -219,7 +218,7 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting
         return;
     }
 
-    if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
+    if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
 
     // PM for night hours, otherwise the night hours are counted from 13
     if ( state->night ) {
@@ -247,9 +246,6 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting
     state->scratch.unit.minute = floor(current_minute);
     state->scratch.unit.second = (uint8_t)floor(current_second) % 60;
 
-    if (settings->bit.clock_mode_24h && settings->bit.clock_24h_leading_zero && state->scratch.unit.hour < 10)
-        set_leading_zero = true;
-
     // what weekday is it (0 - 6)
     weekday = watch_utility_get_iso8601_weekday_number(state->scratch.unit.year, state->scratch.unit.month, state->scratch.unit.day) - 1;
 
@@ -267,8 +263,6 @@ static void _planetary_time(movement_event_t event, movement_settings_t *setting
     else sprintf(buf, "%s h%2d%02d%02d", ruler, state->scratch.unit.hour, state->scratch.unit.minute, state->scratch.unit.second);
     
     watch_display_string(buf, 0);
-    if (set_leading_zero)
-        watch_display_string("0", 4);
 
     if ( state->ruler == 2 ) _planetary_icon(planet);
 
index 8747bd868ef414efa3b9ec82fb1d008f0961d670..fbf60cfeeca69c21418afdf6fc7c9f9f74d70673 100644 (file)
@@ -93,7 +93,7 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s
         }
 
         watch_set_colon();
-        if (settings->bit.clock_mode_24h && !settings->bit.clock_24h_leading_zero) watch_set_indicator(WATCH_INDICATOR_24H);
+        if (settings->bit.clock_mode_24h) watch_set_indicator(WATCH_INDICATOR_24H);
 
         rise += hours_from_utc;
         set += hours_from_utc;
@@ -113,17 +113,12 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s
 
         if (date_time.reg < scratch_time.reg || show_next_match) {
             if (state->rise_index == 0 || show_next_match) {
-                bool set_leading_zero = false;
                 if (!settings->bit.clock_mode_24h) {
                     if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM);
                     else watch_clear_indicator(WATCH_INDICATOR_PM);
-                } else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
-                    set_leading_zero = true;
                 }
                 sprintf(buf, "rI%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute,longLatPresets[state->longLatToUse].name);
                 watch_display_string(buf, 0);
-                if (set_leading_zero)
-                    watch_display_string("0", 4);
                 return;
             } else {
                 show_next_match = true;
@@ -145,17 +140,12 @@ static void _sunrise_sunset_face_update(movement_settings_t *settings, sunrise_s
 
         if (date_time.reg < scratch_time.reg || show_next_match) {
             if (state->rise_index == 0 || show_next_match) {
-                bool set_leading_zero = false;
                 if (!settings->bit.clock_mode_24h) {
                     if (watch_utility_convert_to_12_hour(&scratch_time)) watch_set_indicator(WATCH_INDICATOR_PM);
                     else watch_clear_indicator(WATCH_INDICATOR_PM);
-                } else if (settings->bit.clock_24h_leading_zero && scratch_time.unit.hour < 10) {
-                    set_leading_zero = true;
                 }
                 sprintf(buf, "SE%2d%2d%02d%s", scratch_time.unit.day, scratch_time.unit.hour, scratch_time.unit.minute, longLatPresets[state->longLatToUse].name);
                 watch_display_string(buf, 0);
-                if (set_leading_zero)
-                    watch_display_string("0", 4);
                 return;
             } else {
                 show_next_match = true;
index e645b25c219a78d582546c3072fbb714d8cac0ec..6fa801fa9cc09c618d7b48c9ef3d2898e6a3a8fd 100644 (file)
@@ -38,15 +38,12 @@ void _wake_face_update_display(movement_settings_t *settings, wake_face_state_t
     uint8_t hour = state->hour;
 
     watch_clear_display();
-    bool set_leading_zero = false;
-    if ( !settings->bit.clock_mode_24h ) {
+    if ( settings->bit.clock_mode_24h )
+        watch_set_indicator(WATCH_INDICATOR_24H);
+    else {
         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 )
@@ -57,8 +54,6 @@ 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);
 }
 
 //
index 3b4827a90e1469458d36f6159dfc1cdd0f007c6f..b76c134f7cea642debaf7726fd7544de725d113d 100644 (file)
@@ -41,7 +41,6 @@ static void _lis2dw_logging_face_update_display(movement_settings_t *settings, l
     char time_indication_character;
     int8_t pos;
     watch_date_time date_time;
-    bool set_leading_zero = false;
 
     if (logger_state->log_ticks) {
         pos = (logger_state->data_points - 1 - logger_state->display_index) % LIS2DW_LOGGING_NUM_DATA_POINTS;
@@ -51,14 +50,12 @@ static void _lis2dw_logging_face_update_display(movement_settings_t *settings, l
         } else {
             date_time = logger_state->data[pos].timestamp;
             watch_set_colon();
-            if (!settings->bit.clock_mode_24h) {
+            if (settings->bit.clock_mode_24h) {
+                watch_set_indicator(WATCH_INDICATOR_24H);
+            } else {
                 if (date_time.unit.hour > 11) watch_set_indicator(WATCH_INDICATOR_PM);
                 date_time.unit.hour %= 12;
                 if (date_time.unit.hour == 0) date_time.unit.hour = 12;
-            } else if (!settings->bit.clock_24h_leading_zero) {
-                watch_set_indicator(WATCH_INDICATOR_24H);
-            } else if (date_time.unit.hour < 10) {
-                set_leading_zero = true;
             }
             switch (logger_state->axis_index) {
                 case 0:
@@ -92,9 +89,6 @@ static void _lis2dw_logging_face_update_display(movement_settings_t *settings, l
             logger_state->interrupts[2]);
     }
     watch_display_string(buf, 0);
-    if (set_leading_zero)
-        watch_display_string("0", 4);
-    printf("%s\n", buf);
 }
 
 static void _lis2dw_logging_face_log_data(lis2dw_logger_state_t *logger_state) {
index 18625cce2c67de344400599fab2d32a2bd82f254..64f605e9aeed3d434b563df298268da7ef4fe1e8 100644 (file)
@@ -40,10 +40,9 @@ static void _thermistor_logging_face_log_data(thermistor_logger_state_t *logger_
     thermistor_driver_disable();
 }
 
-static void _thermistor_logging_face_update_display(thermistor_logger_state_t *logger_state, bool in_fahrenheit, bool clock_mode_24h, bool clock_24h_leading_zero) {
+static void _thermistor_logging_face_update_display(thermistor_logger_state_t *logger_state, bool in_fahrenheit, bool clock_mode_24h) {
     int8_t pos = (logger_state->data_points - 1 - logger_state->display_index) % THERMISTOR_LOGGING_NUM_DATA_POINTS;
     char buf[14];
-    bool set_leading_zero = false;
 
     watch_clear_indicator(WATCH_INDICATOR_24H);
     watch_clear_indicator(WATCH_INDICATOR_PM);
@@ -54,14 +53,12 @@ static void _thermistor_logging_face_update_display(thermistor_logger_state_t *l
     } else if (logger_state->ts_ticks) {
         watch_date_time date_time = logger_state->data[pos].timestamp;
         watch_set_colon();
-        if (!clock_mode_24h) {
+        if (clock_mode_24h) {
+            watch_set_indicator(WATCH_INDICATOR_24H);
+        } else {
             if (date_time.unit.hour > 11) watch_set_indicator(WATCH_INDICATOR_PM);
             date_time.unit.hour %= 12;
             if (date_time.unit.hour == 0) date_time.unit.hour = 12;
-        } else if (!clock_24h_leading_zero) {
-            watch_set_indicator(WATCH_INDICATOR_24H);
-        } else if (date_time.unit.hour < 10) {
-            set_leading_zero = true;
         }
         sprintf(buf, "AT%2d%2d%02d%02d", date_time.unit.day, date_time.unit.hour, date_time.unit.minute, date_time.unit.second);
     } else {
@@ -73,8 +70,6 @@ static void _thermistor_logging_face_update_display(thermistor_logger_state_t *l
     }
 
     watch_display_string(buf, 0);
-    if (set_leading_zero)
-        watch_display_string("0", 4);
 }
 
 void thermistor_logging_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
@@ -105,18 +100,18 @@ bool thermistor_logging_face_loop(movement_event_t event, movement_settings_t *s
             break;
         case EVENT_LIGHT_BUTTON_DOWN:
             logger_state->ts_ticks = 2;
-            _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, settings->bit.clock_mode_24h, settings->bit.clock_24h_leading_zero);
+            _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, settings->bit.clock_mode_24h);
             break;
         case EVENT_ALARM_BUTTON_DOWN:
             logger_state->display_index = (logger_state->display_index + 1) % THERMISTOR_LOGGING_NUM_DATA_POINTS;
             logger_state->ts_ticks = 0;
             // fall through
         case EVENT_ACTIVATE:
-            _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, settings->bit.clock_mode_24h, settings->bit.clock_24h_leading_zero);
+            _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, settings->bit.clock_mode_24h);
             break;
         case EVENT_TICK:
             if (logger_state->ts_ticks && --logger_state->ts_ticks == 0) {
-                _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, settings->bit.clock_mode_24h, settings->bit.clock_24h_leading_zero);
+                _thermistor_logging_face_update_display(logger_state, settings->bit.use_imperial_units, settings->bit.clock_mode_24h);
             }
             break;
         case EVENT_BACKGROUND_TASK:
index 24836dceefc1183ff25dbf67354a6e18dc1b7405..b913d8c4fd94536f0147396669d6a3accc21d606 100644 (file)
@@ -96,14 +96,6 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings
                     break;
             }
             break;
-        case EVENT_ALARM_LONG_PRESS:
-            switch (current_page) {
-                case 0:
-                    if (settings->bit.clock_mode_24h)
-                        settings->bit.clock_24h_leading_zero = !(settings->bit.clock_24h_leading_zero);
-                    break;
-            }
-            break;
         case EVENT_TIMEOUT:
             movement_move_to_face(0);
             break;
@@ -120,10 +112,8 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings
         char buf[8];
         switch (current_page) {
             case 0:
-                if (settings->bit.clock_mode_24h) {
-                    if (settings->bit.clock_24h_leading_zero) watch_display_string("024h", 4);
-                    else watch_display_string("24h", 4);
-                } else watch_display_string("12h", 4);
+                if (settings->bit.clock_mode_24h) watch_display_string("24h", 4);
+                else watch_display_string("12h", 4);
                 break;
             case 1:
                 if (settings->bit.button_should_sound) watch_display_string("y", 9);
index 75bc7bb46070b019f6871615309e7906548b2bf6..2f4c0341bb5fda96d2bef0c61998c5c6020d0e3d 100644 (file)
@@ -189,14 +189,10 @@ bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *s
     }
 
     char buf[11];
-    bool set_leading_zero = false;
     if (current_page < 3) {
         watch_set_colon();
         if (settings->bit.clock_mode_24h) {
-            if (!settings->bit.clock_24h_leading_zero)
-                watch_set_indicator(WATCH_INDICATOR_24H);
-            else if (date_time_settings.unit.hour < 10)
-                set_leading_zero = true;
+            watch_set_indicator(WATCH_INDICATOR_24H);
             sprintf(buf,
                     "%s  %2d%02d%02d",
                     set_time_hackwatch_face_titles[current_page],
@@ -262,8 +258,6 @@ bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *s
     }
 
     watch_display_string(buf, 0);
-    if (set_leading_zero)
-        watch_display_string("0", 4);
 
     return true;
 }
index 8a9f16643c3f4cdea7df2325257cb049d2c78cfa..bf30305959de0afbf0ba0a83bde6b60d32e33d06 100644 (file)
@@ -99,7 +99,6 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
             // ...and set the LAP indicator if low.
             if (state->battery_low) watch_set_indicator(WATCH_INDICATOR_LAP);
 
-            bool set_leading_zero = false;
             if ((date_time.reg >> 6) == (previous_date_time >> 6) && event.event_type != EVENT_LOW_ENERGY_UPDATE) {
                 // everything before seconds is the same, don't waste cycles setting those segments.
                 watch_display_character_lp_seconds('0' + date_time.unit.second / 10, 8);
@@ -123,11 +122,6 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
                     if (date_time.unit.hour == 0) date_time.unit.hour = 12;
                 }
 #endif
-
-                if (settings->bit.clock_mode_24h && settings->bit.clock_24h_leading_zero && date_time.unit.hour < 10) {
-                    set_leading_zero = true;
-                }
-
                 watch_display_top_left(watch_utility_get_weekday(date_time));
                 sprintf(buf, "%2d%2d%02d%02d", date_time.unit.day, date_time.unit.hour, date_time.unit.minute, date_time.unit.second);
                 watch_display_top_right(buf);
@@ -140,9 +134,6 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
                 }
             }
 
-            if (set_leading_zero)
-                watch_display_string("0", 4);
-
             // handle alarm indicator
             if (state->alarm_enabled != settings->bit.alarm_enabled) _update_alarm_indicator(settings->bit.alarm_enabled, state);
             break;
index 09bda392aff808e8e4a09d71245dc12cb96fbcfd..9fb8bb63fd3de04d3a07a2e85da792a576ea4ff1 100644 (file)
@@ -126,14 +126,10 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v
     }
 
     char buf[11];
-    bool set_leading_zero = false;
     if (current_page < 3) {
         watch_set_colon();
         if (settings->bit.clock_mode_24h) {
-            if (!settings->bit.clock_24h_leading_zero)
-                watch_set_indicator(WATCH_INDICATOR_24H);
-            else if (date_time.unit.hour < 10)
-                set_leading_zero = true;
+            watch_set_indicator(WATCH_INDICATOR_24H);
             sprintf(buf, "%s  %2d%02d%02d", set_time_face_titles[current_page], date_time.unit.hour, date_time.unit.minute, date_time.unit.second);
         } else {
             sprintf(buf, "%s  %2d%02d%02d", set_time_face_titles[current_page], (date_time.unit.hour % 12) ? (date_time.unit.hour % 12) : 12, date_time.unit.minute, date_time.unit.second);
@@ -174,8 +170,6 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v
     }
 
     watch_display_string(buf, 0);
-    if (set_leading_zero)
-        watch_display_string("0", 4);
 
     return true;
 }