From d36331ce4e79d275e0ef09414a1a1a1a8949b0ea Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Sat, 16 Oct 2021 13:23:23 -0400 Subject: rename types to be more c-like --- movement/watch_faces/clock/simple_clock_face.c | 8 ++++---- movement/watch_faces/clock/simple_clock_face.h | 8 ++++---- movement/watch_faces/complications/pulseometer_face.c | 8 ++++---- movement/watch_faces/complications/pulseometer_face.h | 8 ++++---- movement/watch_faces/settings/preferences_face.c | 8 ++++---- movement/watch_faces/settings/preferences_face.h | 8 ++++---- movement/watch_faces/settings/set_time_face.c | 8 ++++---- movement/watch_faces/settings/set_time_face.h | 8 ++++---- 8 files changed, 32 insertions(+), 32 deletions(-) (limited to 'movement/watch_faces') diff --git a/movement/watch_faces/clock/simple_clock_face.c b/movement/watch_faces/clock/simple_clock_face.c index 97067b0f..bdee7dec 100644 --- a/movement/watch_faces/clock/simple_clock_face.c +++ b/movement/watch_faces/clock/simple_clock_face.c @@ -2,13 +2,13 @@ #include "simple_clock_face.h" #include "watch.h" -void simple_clock_face_setup(LauncherSettings *settings, void ** context_ptr) { +void simple_clock_face_setup(movement_settings_t *settings, void ** context_ptr) { (void) settings; // the only context we need is the timestamp of the previous tick. if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint32_t)); } -void simple_clock_face_activate(LauncherSettings *settings, void *context) { +void simple_clock_face_activate(movement_settings_t *settings, void *context) { if (settings->bit.clock_mode_24h) { watch_set_indicator(WATCH_INDICATOR_24H); } @@ -17,7 +17,7 @@ void simple_clock_face_activate(LauncherSettings *settings, void *context) { *((uint32_t *)context) = 0xFFFFFFFF; } -bool simple_clock_face_loop(LauncherEvent event, LauncherSettings *settings, void *context) { +bool simple_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { printf("simple_clock_face_loop\n"); const char weekdays[7][3] = {"SA", "SU", "MO", "TU", "WE", "TH", "FR"}; char buf[11]; @@ -77,7 +77,7 @@ bool simple_clock_face_loop(LauncherEvent event, LauncherSettings *settings, voi return true; } -void simple_clock_face_resign(LauncherSettings *settings, void *context) { +void simple_clock_face_resign(movement_settings_t *settings, void *context) { (void) settings; (void) context; } diff --git a/movement/watch_faces/clock/simple_clock_face.h b/movement/watch_faces/clock/simple_clock_face.h index 59201a1f..3cdc09e8 100644 --- a/movement/watch_faces/clock/simple_clock_face.h +++ b/movement/watch_faces/clock/simple_clock_face.h @@ -3,10 +3,10 @@ #include "movement.h" -void simple_clock_face_setup(LauncherSettings *settings, void ** context_ptr); -void simple_clock_face_activate(LauncherSettings *settings, void *context); -bool simple_clock_face_loop(LauncherEvent event, LauncherSettings *settings, void *context); -void simple_clock_face_resign(LauncherSettings *settings, void *context); +void simple_clock_face_setup(movement_settings_t *settings, void ** context_ptr); +void simple_clock_face_activate(movement_settings_t *settings, void *context); +bool simple_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context); +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); diff --git a/movement/watch_faces/complications/pulseometer_face.c b/movement/watch_faces/complications/pulseometer_face.c index e38153d6..7c524b8d 100644 --- a/movement/watch_faces/complications/pulseometer_face.c +++ b/movement/watch_faces/complications/pulseometer_face.c @@ -6,17 +6,17 @@ #define PULSOMETER_FACE_FREQUENCY_FACTOR (4ul) // refresh rate will be 2 to this power Hz (0 for 1 Hz, 2 for 4 Hz, etc.) #define PULSOMETER_FACE_FREQUENCY (1 << PULSOMETER_FACE_FREQUENCY_FACTOR) -void pulseometer_face_setup(LauncherSettings *settings, void ** context_ptr) { +void pulseometer_face_setup(movement_settings_t *settings, void ** context_ptr) { (void) settings; if (*context_ptr == NULL) *context_ptr = malloc(sizeof(PulsometerState)); } -void pulseometer_face_activate(LauncherSettings *settings, void *context) { +void pulseometer_face_activate(movement_settings_t *settings, void *context) { (void) settings; memset(context, 0, sizeof(PulsometerState)); } -bool pulseometer_face_loop(LauncherEvent event, LauncherSettings *settings, void *context) { +bool pulseometer_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { printf("pulseometer_face_loop\n"); (void) settings; PulsometerState *pulsometer_state = (PulsometerState *)context; @@ -81,7 +81,7 @@ bool pulseometer_face_loop(LauncherEvent event, LauncherSettings *settings, void return true; } -void pulseometer_face_resign(LauncherSettings *settings, void *context) { +void pulseometer_face_resign(movement_settings_t *settings, void *context) { (void) settings; (void) context; } diff --git a/movement/watch_faces/complications/pulseometer_face.h b/movement/watch_faces/complications/pulseometer_face.h index 7b96259c..f8e69d27 100644 --- a/movement/watch_faces/complications/pulseometer_face.h +++ b/movement/watch_faces/complications/pulseometer_face.h @@ -9,10 +9,10 @@ typedef struct { int16_t ticks; } PulsometerState; -void pulseometer_face_setup(LauncherSettings *settings, void ** context_ptr); -void pulseometer_face_activate(LauncherSettings *settings, void *context); -bool pulseometer_face_loop(LauncherEvent event, LauncherSettings *settings, void *context); -void pulseometer_face_resign(LauncherSettings *settings, void *context); +void pulseometer_face_setup(movement_settings_t *settings, void ** context_ptr); +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, \ diff --git a/movement/watch_faces/settings/preferences_face.c b/movement/watch_faces/settings/preferences_face.c index f499e36f..18dff6cd 100644 --- a/movement/watch_faces/settings/preferences_face.c +++ b/movement/watch_faces/settings/preferences_face.c @@ -5,18 +5,18 @@ #define PREFERENCES_FACE_NUM_PREFEFENCES (5) const char preferences_face_titles[PREFERENCES_FACE_NUM_PREFEFENCES][11] = {"CL ", "Bt Beep ", "SC ", "Lt grn ", "Lt red "}; -void preferences_face_setup(LauncherSettings *settings, void ** context_ptr) { +void preferences_face_setup(movement_settings_t *settings, void ** context_ptr) { (void) settings; if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint8_t)); } -void preferences_face_activate(LauncherSettings *settings, void *context) { +void preferences_face_activate(movement_settings_t *settings, void *context) { (void) settings; *((uint8_t *)context) = 0; movement_request_tick_frequency(4); // we need to manually blink some pixels } -bool preferences_face_loop(LauncherEvent event, LauncherSettings *settings, void *context) { +bool preferences_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { printf("preferences_face_loop\n"); uint8_t current_page = *((uint8_t *)context); switch (event.event_type) { @@ -112,7 +112,7 @@ bool preferences_face_loop(LauncherEvent event, LauncherSettings *settings, void return true; } -void preferences_face_resign(LauncherSettings *settings, void *context) { +void preferences_face_resign(movement_settings_t *settings, void *context) { (void) settings; (void) context; watch_set_led_off(); diff --git a/movement/watch_faces/settings/preferences_face.h b/movement/watch_faces/settings/preferences_face.h index 218f99c2..c8f1a14e 100644 --- a/movement/watch_faces/settings/preferences_face.h +++ b/movement/watch_faces/settings/preferences_face.h @@ -3,10 +3,10 @@ #include "movement.h" -void preferences_face_setup(LauncherSettings *settings, void ** context_ptr); -void preferences_face_activate(LauncherSettings *settings, void *context); -bool preferences_face_loop(LauncherEvent event, LauncherSettings *settings, void *context); -void preferences_face_resign(LauncherSettings *settings, void *context); +void preferences_face_setup(movement_settings_t *settings, void ** context_ptr); +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, \ diff --git a/movement/watch_faces/settings/set_time_face.c b/movement/watch_faces/settings/set_time_face.c index 36498611..7bb63d0b 100644 --- a/movement/watch_faces/settings/set_time_face.c +++ b/movement/watch_faces/settings/set_time_face.c @@ -5,18 +5,18 @@ #define SET_TIME_FACE_NUM_SETTINGS (6) const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "MN", "SE", "YR", "MO", "DA"}; -void set_time_face_setup(LauncherSettings *settings, void ** context_ptr) { +void set_time_face_setup(movement_settings_t *settings, void ** context_ptr) { (void) settings; if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint8_t)); } -void set_time_face_activate(LauncherSettings *settings, void *context) { +void set_time_face_activate(movement_settings_t *settings, void *context) { (void) settings; *((uint8_t *)context) = 0; movement_request_tick_frequency(4); } -bool set_time_face_loop(LauncherEvent event, LauncherSettings *settings, void *context) { +bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context) { uint8_t current_page = *((uint8_t *)context); const uint8_t days_in_month[12] = {31, 28, 31, 30, 31, 30, 30, 31, 30, 31, 30, 31}; watch_date_time date_time = watch_rtc_get_date_time(); @@ -101,7 +101,7 @@ bool set_time_face_loop(LauncherEvent event, LauncherSettings *settings, void *c return true; } -void set_time_face_resign(LauncherSettings *settings, void *context) { +void set_time_face_resign(movement_settings_t *settings, void *context) { (void) settings; (void) context; watch_set_led_off(); diff --git a/movement/watch_faces/settings/set_time_face.h b/movement/watch_faces/settings/set_time_face.h index 0c34d6b2..b330d852 100644 --- a/movement/watch_faces/settings/set_time_face.h +++ b/movement/watch_faces/settings/set_time_face.h @@ -3,10 +3,10 @@ #include "movement.h" -void set_time_face_setup(LauncherSettings *settings, void ** context_ptr); -void set_time_face_activate(LauncherSettings *settings, void *context); -bool set_time_face_loop(LauncherEvent event, LauncherSettings *settings, void *context); -void set_time_face_resign(LauncherSettings *settings, void *context); +void set_time_face_setup(movement_settings_t *settings, void ** context_ptr); +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, \ -- cgit v1.2.3