]> git.earman.xyz Git - sensor-watch.git/commitdiff
french_revolutionary face: fix compiler warning and uninitialized date_time variable
authorCarpeNoctem <cryptomax@pm.me>
Wed, 17 Jan 2024 11:47:16 +0000 (22:47 +1100)
committerMatheus Afonso Martins Moreira <matheus@matheusmoreira.com>
Sat, 7 Sep 2024 22:47:17 +0000 (19:47 -0300)
movement/watch_faces/clock/french_revolutionary_face.c

index 519cfc3612146faa484e1c1ed4b53ef83f12d746..da94fc978e71ea9ca823af506c69fc5a9ec9ba99 100644 (file)
@@ -28,6 +28,7 @@
 
 void french_revolutionary_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
     (void) settings;
+    (void) watch_face_index;
     if (*context_ptr == NULL) {
         *context_ptr = malloc(sizeof(french_revolutionary_state_t));
         memset(*context_ptr, 0, sizeof(french_revolutionary_state_t));
@@ -64,7 +65,7 @@ bool french_revolutionary_face_loop(movement_event_t event, movement_settings_t
             break;
         case EVENT_TICK:
         case EVENT_LOW_ENERGY_UPDATE:
-            
+
             date_time = watch_rtc_get_date_time();
 
             decimal_time = get_decimal_time(&date_time);
@@ -107,6 +108,7 @@ bool french_revolutionary_face_loop(movement_event_t event, movement_settings_t
             state->use_am_pm = !state->use_am_pm;
             if (state->use_am_pm) {
                 watch_clear_indicator(WATCH_INDICATOR_24H);
+                date_time = watch_rtc_get_date_time();
                 if (date_time.unit.hour < 12) { watch_clear_indicator(WATCH_INDICATOR_PM); }
                 else { watch_set_indicator(WATCH_INDICATOR_PM); }
             } else {
@@ -240,4 +242,4 @@ char fix_character_one(char digit) {
             break;
     }
     return return_char;
-}
\ No newline at end of file
+}