]> git.earman.xyz Git - sensor-watch.git/commitdiff
faces/clock: define general indication function
authorMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Sat, 24 Feb 2024 22:16:06 +0000 (19:16 -0300)
committerMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Sun, 25 Feb 2024 18:24:14 +0000 (15:24 -0300)
Sets or clears the specified indicator based on some boolean value.

movement/watch_faces/clock/clock_face.c

index 070968a78ef97838bcb0b7f010c0939f0a0290c6..24e33c9c5dddc2ea652e79ad3397f6177d3af601 100644 (file)
@@ -37,6 +37,14 @@ typedef struct {
     bool alarm_enabled;
 } clock_state_t;
 
+static void clock_indicate(WatchIndicatorSegment indicator, bool on) {
+    if (on) {
+        watch_set_indicator(indicator);
+    } else {
+        watch_clear_indicator(indicator);
+    }
+}
+
 static void _update_alarm_indicator(bool settings_alarm_enabled, clock_state_t *state) {
     state->alarm_enabled = settings_alarm_enabled;
     if (state->alarm_enabled) watch_set_indicator(WATCH_INDICATOR_SIGNAL);