]> git.earman.xyz Git - sensor-watch.git/commitdiff
faces/clock: reorder periodic battery check
authorMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Sun, 25 Feb 2024 16:31:28 +0000 (13:31 -0300)
committerMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Sun, 25 Feb 2024 18:24:14 +0000 (15:24 -0300)
Check the battery after the time has been updated.
Place all the indication code next to each other.

movement/watch_faces/clock/clock_face.c

index 36f21ff9ef6c52e48e9214d681a1961625a59f4e..4fe02376fc5fa67f1fcfc56edc07d517f49ba0d0 100644 (file)
@@ -218,9 +218,6 @@ bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void
             previous.reg = state->previous_date_time;
             state->previous_date_time = current.reg;
 
-            clock_check_battery_periodically(state, date_time);
-            clock_indicate_low_available_power(state);
-
             if (!clock_display_some(current, previous)) {
                 if (!settings->bit.clock_mode_24h) {
                     // if we are in 12 hour mode, do some cleanup.
@@ -230,8 +227,10 @@ bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void
                 clock_display_all(current);
             }
 
+            clock_check_battery_periodically(state, current);
 
             clock_indicate_alarm(settings);
+            clock_indicate_low_available_power(state);
 
             break;
         case EVENT_ALARM_LONG_PRESS: