From: Matheus Afonso Martins Moreira Date: Sat, 24 Feb 2024 22:16:06 +0000 (-0300) Subject: faces/clock: define general indication function X-Git-Url: https://git.earman.xyz/?a=commitdiff_plain;h=e6d8b6aaff4e67aee68c34156f3a781aaa8c2709;p=sensor-watch.git faces/clock: define general indication function Sets or clears the specified indicator based on some boolean value. --- diff --git a/movement/watch_faces/clock/clock_face.c b/movement/watch_faces/clock/clock_face.c index 070968a..24e33c9 100644 --- a/movement/watch_faces/clock/clock_face.c +++ b/movement/watch_faces/clock/clock_face.c @@ -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);