diff options
author | Joey Castillo <jose.castillo@gmail.com> | 2021-10-16 16:25:30 -0400 |
---|---|---|
committer | Joey Castillo <jose.castillo@gmail.com> | 2021-10-16 16:34:12 -0400 |
commit | 05fe055f99b9b950086b1e38a9c795d7e076c5b2 (patch) | |
tree | 9f086f0e5f11c24868295bcc3c37cb4063a861d9 /movement | |
parent | 0cfb37c6716326dea78a8dca512d286e6484e509 (diff) | |
download | Sensor-Watch-05fe055f99b9b950086b1e38a9c795d7e076c5b2.tar.gz Sensor-Watch-05fe055f99b9b950086b1e38a9c795d7e076c5b2.tar.bz2 Sensor-Watch-05fe055f99b9b950086b1e38a9c795d7e076c5b2.zip |
automatically determine number of watch faces
Diffstat (limited to 'movement')
-rw-r--r-- | movement/movement_config.h | 5 | ||||
-rw-r--r-- | movement/watch_faces/clock/simple_clock_face.h | 16 | ||||
-rw-r--r-- | movement/watch_faces/complications/pulseometer_face.h | 14 | ||||
-rw-r--r-- | movement/watch_faces/settings/preferences_face.h | 14 | ||||
-rw-r--r-- | movement/watch_faces/settings/set_time_face.h | 14 |
5 files changed, 31 insertions, 32 deletions
diff --git a/movement/movement_config.h b/movement/movement_config.h index 172736f1..e95e46c0 100644 --- a/movement/movement_config.h +++ b/movement/movement_config.h @@ -6,13 +6,12 @@ #include "set_time_face.h" #include "pulseometer_face.h" -#define MOVEMENT_NUM_FACES 3 - -watch_face_t watch_faces[MOVEMENT_NUM_FACES] = { +const watch_face_t watch_faces[] = { simple_clock_face, preferences_face, set_time_face, }; +#define MOVEMENT_NUM_FACES (sizeof(watch_faces) / sizeof(watch_face_t)) #endif // MOVEMENT_CONFIG_H_ diff --git a/movement/watch_faces/clock/simple_clock_face.h b/movement/watch_faces/clock/simple_clock_face.h index 7daaba3e..3db894d2 100644 --- a/movement/watch_faces/clock/simple_clock_face.h +++ b/movement/watch_faces/clock/simple_clock_face.h @@ -10,12 +10,12 @@ void simple_clock_face_resign(movement_settings_t *settings, void *context); uint8_t simple_clock_face_get_weekday(uint16_t day, uint16_t month, uint16_t year); -#define simple_clock_face { \ - simple_clock_face_setup, \ - simple_clock_face_activate, \ - simple_clock_face_loop, \ - simple_clock_face_resign, \ - NULL, \ -} +static const watch_face_t simple_clock_face = { + simple_clock_face_setup, + simple_clock_face_activate, + simple_clock_face_loop, + simple_clock_face_resign, + NULL +}; -#endif // FAKE_FACE_H_
\ No newline at end of file +#endif // SIMPLE_CLOCK_FACE_H_
\ No newline at end of file diff --git a/movement/watch_faces/complications/pulseometer_face.h b/movement/watch_faces/complications/pulseometer_face.h index 5a9c66b0..52bccf24 100644 --- a/movement/watch_faces/complications/pulseometer_face.h +++ b/movement/watch_faces/complications/pulseometer_face.h @@ -14,12 +14,12 @@ void pulseometer_face_activate(movement_settings_t *settings, void *context); bool pulseometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context); void pulseometer_face_resign(movement_settings_t *settings, void *context); -#define pulseometer_face { \ - pulseometer_face_setup, \ - pulseometer_face_activate, \ - pulseometer_face_loop, \ - pulseometer_face_resign, \ - NULL, \ -} +static const watch_face_t pulseometer_face = { + pulseometer_face_setup, + pulseometer_face_activate, + pulseometer_face_loop, + pulseometer_face_resign, + NULL +}; #endif // PULSEOMETER_FACE_H_
\ No newline at end of file diff --git a/movement/watch_faces/settings/preferences_face.h b/movement/watch_faces/settings/preferences_face.h index 5b735db9..af628ba3 100644 --- a/movement/watch_faces/settings/preferences_face.h +++ b/movement/watch_faces/settings/preferences_face.h @@ -8,12 +8,12 @@ void preferences_face_activate(movement_settings_t *settings, void *context); bool preferences_face_loop(movement_event_t event, movement_settings_t *settings, void *context); void preferences_face_resign(movement_settings_t *settings, void *context); -#define preferences_face { \ - preferences_face_setup, \ - preferences_face_activate, \ - preferences_face_loop, \ - preferences_face_resign, \ - NULL, \ -} +static const watch_face_t preferences_face = { + preferences_face_setup, + preferences_face_activate, + preferences_face_loop, + preferences_face_resign, + NULL +}; #endif // PREFERENCES_FACE_H_
\ No newline at end of file diff --git a/movement/watch_faces/settings/set_time_face.h b/movement/watch_faces/settings/set_time_face.h index 06dbe2ce..21fb1e44 100644 --- a/movement/watch_faces/settings/set_time_face.h +++ b/movement/watch_faces/settings/set_time_face.h @@ -8,12 +8,12 @@ void set_time_face_activate(movement_settings_t *settings, void *context); bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context); void set_time_face_resign(movement_settings_t *settings, void *context); -#define set_time_face { \ - set_time_face_setup, \ - set_time_face_activate, \ - set_time_face_loop, \ - set_time_face_resign, \ - NULL, \ -} +static const watch_face_t set_time_face = { + set_time_face_setup, + set_time_face_activate, + set_time_face_loop, + set_time_face_resign, + NULL +}; #endif // SET_TIME_FACE_H_ |