]> git.earman.xyz Git - sensor-watch.git/commitdiff
custom LCD now has an 'arrows' indicator instead of a battery
authorJoey Castillo <joeycastillo@utexas.edu>
Tue, 13 May 2025 02:34:27 +0000 (22:34 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Tue, 13 May 2025 02:37:37 +0000 (22:37 -0400)
watch-faces/clock/clock_face.c
watch-faces/sensor/activity_logging_face.c
watch-library/hardware/watch/watch_slcd.c
watch-library/shared/watch/watch_common_display.c
watch-library/shared/watch/watch_slcd.h

index f120b1094e0925ddf817c3965491d8db407674b3..ca56ece98e6a17f914b83a9bec9aeb1d3001c5ee 100644 (file)
@@ -82,8 +82,14 @@ static void clock_indicate_pm(watch_date_time_t date_time) {
 }
 
 static void clock_indicate_low_available_power(clock_state_t *clock) {
-    // Set the LAP indicator if battery power is low
-    clock_indicate(WATCH_INDICATOR_LAP, clock->battery_low);
+    // Set the low battery indicator if battery power is low
+    if (watch_get_lcd_type() == WATCH_LCD_TYPE_CUSTOM) {
+        // interlocking arrows imply "exchange" the battery.
+        clock_indicate(WATCH_INDICATOR_ARROWS, clock->battery_low);
+    } else {
+        // LAP indicator on classic LCD is an adequate fallback.
+        clock_indicate(WATCH_INDICATOR_LAP, clock->battery_low);
+    }
 }
 
 static watch_date_time_t clock_24h_to_12h(watch_date_time_t date_time) {
index d540c3237539683b764824b58acab373de049a73..984d9a098e207df241962d51501b43c824b4609b 100644 (file)
@@ -119,8 +119,7 @@ bool activity_logging_face_loop(movement_event_t event, void *context) {
             break;
         case EVENT_ALARM_LONG_PRESS:
             state->data_dump_idx = 0;
-            /// FIXME: Battery indicator is now Arrows indicator.
-            watch_set_indicator(WATCH_INDICATOR_BATTERY);
+            watch_set_indicator(WATCH_INDICATOR_ARROWS);
             movement_request_tick_frequency(4);
             watch_set_decimal_if_available();
             // fall through
@@ -146,8 +145,7 @@ bool activity_logging_face_loop(movement_event_t event, void *context) {
                 state->data_dump_idx++;
                 if (state->data_dump_idx >= MOVEMENT_NUM_DATA_POINTS) {
                     state->data_dump_idx = -1;
-                    /// FIXME: Battery indicator is now Arrows indicator.
-                    watch_clear_indicator(WATCH_INDICATOR_BATTERY);
+                    watch_clear_indicator(WATCH_INDICATOR_ARROWS);
                     watch_clear_decimal_if_available();
                     movement_request_tick_frequency(1);
                     state->display_index = 0;
index 731f4c5372fe9bf0bce8632321af814fdcc788bb..4c591d9e708e61ac4be32866be1b711aa06ad910 100644 (file)
@@ -248,7 +248,7 @@ void watch_start_indicator_blink_if_possible(watch_indicator_t indicator, uint32
         case WATCH_INDICATOR_LAP:
             mask = 0b0010;
             break;
-        case WATCH_INDICATOR_BATTERY:
+        case WATCH_INDICATOR_ARROWS:
             mask = 0b0100;
             break;
         case WATCH_INDICATOR_SLEEP:
index 9332bcee9d479ec5a822847de496a07b20327db7..003f2705bb05db38c3714c799d2eab2e39b65c62 100644 (file)
@@ -36,8 +36,8 @@ uint32_t IndicatorSegments[7] = {
     SLCD_SEGID(2, 16), // WATCH_INDICATOR_24H
     SLCD_SEGID(1, 10), // WATCH_INDICATOR_LAP
 
-    // Aliases for indicators unavailable on the original F-91W LCD
-    SLCD_SEGID(1, 10), // WATCH_INDICATOR_BATTERY (same as LAP)
+    // Placeholders for indicators unavailable on the original F-91W LCD
+    SLCD_SEGID(4, 0),  // WATCH_INDICATOR_ARROWS (does not exist, will set in SDATAL4 which is harmless)
     SLCD_SEGID(4, 0)   // WATCH_INDICATOR_SLEEP (does not exist, will set in SDATAL4 which is harmless)
 };
 
@@ -374,7 +374,7 @@ void watch_clear_all_indicators(void) {
     watch_clear_indicator(WATCH_INDICATOR_PM);
     watch_clear_indicator(WATCH_INDICATOR_24H);
     watch_clear_indicator(WATCH_INDICATOR_LAP);
-    watch_clear_indicator(WATCH_INDICATOR_BATTERY);
+    watch_clear_indicator(WATCH_INDICATOR_ARROWS);
     watch_clear_indicator(WATCH_INDICATOR_SLEEP);
 }
 
@@ -385,7 +385,7 @@ void _watch_update_indicator_segments(void) {
         IndicatorSegments[2] = SLCD_SEGID(3, 21); // WATCH_INDICATOR_PM
         IndicatorSegments[3] = SLCD_SEGID(2, 21); // WATCH_INDICATOR_24H
         IndicatorSegments[4] = SLCD_SEGID(1,  0); // WATCH_INDICATOR_LAP
-        IndicatorSegments[5] = SLCD_SEGID(2,  0); // WATCH_INDICATOR_BATTERY
+        IndicatorSegments[5] = SLCD_SEGID(2,  0); // WATCH_INDICATOR_ARROWS
         IndicatorSegments[6] = SLCD_SEGID(3,  0); // WATCH_INDICATOR_SLEEP
     }
 }
index 76ba34ee5fdce2920edb7151d64845c64f70e12e..a129c6e70ef313ea2d35c9876be98469daedb45e 100644 (file)
@@ -52,11 +52,11 @@ typedef enum {
     WATCH_INDICATOR_BELL,       ///< The small bell indicating that an alarm is set.
     WATCH_INDICATOR_PM,         ///< The PM indicator, indicating that a time is in the afternoon.
     WATCH_INDICATOR_24H,        ///< The 24H indicator, indicating that the watch is in a 24-hour mode.
-    WATCH_INDICATOR_LAP,        ///< The LAP indicator; the F-91W uses this in its stopwatch UI.
+    WATCH_INDICATOR_LAP,        ///< The LAP indicator; the F-91W uses this in its stopwatch UI. On custom LCD it's a looped arrow.
 
     // These next indicators are only available on the new custom LCD:
-    WATCH_INDICATOR_BATTERY,    ///< The battery indicator. Will fall back to the LAP icon on the original F-91W LCD.
-    WATCH_INDICATOR_SLEEP,      ///< The sleep indicator. No fallback here; use the tick animation to indicate sleep.
+    WATCH_INDICATOR_ARROWS,     ///< The interlocking arrows indicator; indicates data transfer, or can signal to change the battery.
+    WATCH_INDICATOR_SLEEP,      ///< The sleep indicator.
 
     // You can generally address the colon using dedicated functions, but it's also available here if needed.
     WATCH_INDICATOR_COLON,      ///< The colon between hours and minutes.