diff options
author | Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> | 2024-02-24 18:40:21 -0300 |
---|---|---|
committer | Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com> | 2024-02-25 15:24:14 -0300 |
commit | 01312c2deb1061aeb04fdceb27b2e16608de487b (patch) | |
tree | d8cbbe6f95b38af4f2799f1eed13d6f17a2a7179 | |
parent | 8f040252fd6bfd5c95437a52a07634a19c487086 (diff) | |
download | Sensor-Watch-01312c2deb1061aeb04fdceb27b2e16608de487b.tar.gz Sensor-Watch-01312c2deb1061aeb04fdceb27b2e16608de487b.tar.bz2 Sensor-Watch-01312c2deb1061aeb04fdceb27b2e16608de487b.zip |
faces/clock: move structure definition
Instances of the clock state structure
are only passed to the clock face itself
and only via the opaque context pointer.
No other code uses it.
Thus there is no need to expose it in a header file.
So make it an implementation detail of the watch face
by localizing it inside the translation unit.
-rw-r--r-- | movement/watch_faces/clock/clock_face.c | 9 | ||||
-rw-r--r-- | movement/watch_faces/clock/clock_face.h | 9 |
2 files changed, 9 insertions, 9 deletions
diff --git a/movement/watch_faces/clock/clock_face.c b/movement/watch_faces/clock/clock_face.c index a18bc3a1..070968a7 100644 --- a/movement/watch_faces/clock/clock_face.c +++ b/movement/watch_faces/clock/clock_face.c @@ -28,6 +28,15 @@ #include "watch_utility.h" #include "watch_private_display.h" +typedef struct { + uint32_t previous_date_time; + uint8_t last_battery_check; + uint8_t watch_face_index; + bool signal_enabled; + bool battery_low; + bool alarm_enabled; +} clock_state_t; + 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); diff --git a/movement/watch_faces/clock/clock_face.h b/movement/watch_faces/clock/clock_face.h index d2aa5ecb..f973f270 100644 --- a/movement/watch_faces/clock/clock_face.h +++ b/movement/watch_faces/clock/clock_face.h @@ -37,15 +37,6 @@ #include "movement.h" -typedef struct { - uint32_t previous_date_time; - uint8_t last_battery_check; - uint8_t watch_face_index; - bool signal_enabled; - bool battery_low; - bool alarm_enabled; -} clock_state_t; - void clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr); void clock_face_activate(movement_settings_t *settings, void *context); bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context); |