refactor: watch faces no longer need a pointer to settings!

This commit is contained in:
joeycastillo
2024-09-29 09:59:49 -04:00
parent 3bd8f8d51f
commit e88359d1d5
201 changed files with 1180 additions and 1553 deletions

View File

@@ -29,8 +29,7 @@
const uint8_t BEAT_REFRESH_FREQUENCY = 8;
void beats_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
(void) settings;
void beats_face_setup(uint8_t watch_face_index, void ** context_ptr) {
(void) watch_face_index;
(void) context_ptr;
if (*context_ptr == NULL) {
@@ -38,16 +37,14 @@ void beats_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v
}
}
void beats_face_activate(movement_settings_t *settings, void *context) {
(void) settings;
void beats_face_activate(void *context) {
beats_face_state_t *state = (beats_face_state_t *)context;
state->next_subsecond_update = 0;
state->last_centibeat_displayed = 0;
movement_request_tick_frequency(BEAT_REFRESH_FREQUENCY);
}
bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
(void) settings;
bool beats_face_loop(movement_event_t event, void *context) {
beats_face_state_t *state = (beats_face_state_t *)context;
if (event.event_type == EVENT_TICK && event.subsecond != state->next_subsecond_update) {
return true; // math is hard, don't do it if we don't have to.
@@ -82,15 +79,14 @@ bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void
watch_display_text(WATCH_POSITION_FULL, buf);
break;
default:
movement_default_loop_handler(event, settings);
movement_default_loop_handler(event);
break;
}
return true;
}
void beats_face_resign(movement_settings_t *settings, void *context) {
(void) settings;
void beats_face_resign(void *context) {
(void) context;
}

View File

@@ -44,10 +44,10 @@ typedef struct {
} beats_face_state_t;
uint32_t clock2beats(uint32_t hours, uint32_t minutes, uint32_t seconds, uint32_t subseconds, int16_t utc_offset);
void beats_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
void beats_face_activate(movement_settings_t *settings, void *context);
bool beats_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void beats_face_resign(movement_settings_t *settings, void *context);
void beats_face_setup(uint8_t watch_face_index, void ** context_ptr);
void beats_face_activate(void *context);
bool beats_face_loop(movement_event_t event, void *context);
void beats_face_resign(void *context);
#define beats_face ((const watch_face_t){ \
beats_face_setup, \

View File

@@ -60,7 +60,7 @@ static void clock_indicate(watch_indicator_t indicator, bool on) {
}
}
static void clock_indicate_alarm(movement_settings_t *settings) {
static void clock_indicate_alarm() {
clock_indicate(WATCH_INDICATOR_SIGNAL, movement_alarm_enabled());
}
@@ -68,7 +68,7 @@ static void clock_indicate_time_signal(clock_state_t *clock) {
clock_indicate(WATCH_INDICATOR_BELL, clock->time_signal_enabled);
}
static void clock_indicate_24h(movement_settings_t *settings) {
static void clock_indicate_24h() {
clock_indicate(WATCH_INDICATOR_24H, !!movement_clock_mode_24h());
}
@@ -76,7 +76,7 @@ static bool clock_is_pm(watch_date_time date_time) {
return date_time.unit.hour >= 12;
}
static void clock_indicate_pm(movement_settings_t *settings, watch_date_time date_time) {
static void clock_indicate_pm(watch_date_time date_time) {
if (movement_clock_mode_24h()) { return; }
clock_indicate(WATCH_INDICATOR_PM, clock_is_pm(date_time));
}
@@ -166,10 +166,10 @@ static bool clock_display_some(watch_date_time current, watch_date_time previous
}
}
static void clock_display_clock(movement_settings_t *settings, clock_state_t *clock, watch_date_time current) {
static void clock_display_clock(clock_state_t *clock, watch_date_time current) {
if (!clock_display_some(current, clock->date_time.previous)) {
if (movement_clock_mode_24h() == MOVEMENT_CLOCK_MODE_12H) {
clock_indicate_pm(settings, current);
clock_indicate_pm(current);
current = clock_24h_to_12h(current);
}
clock_display_all(current, movement_clock_mode_24h() == MOVEMENT_CLOCK_MODE_024H);
@@ -204,8 +204,7 @@ static void clock_stop_tick_tock_animation(void) {
}
}
void clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
(void) settings;
void clock_face_setup(uint8_t watch_face_index, void ** context_ptr) {
(void) watch_face_index;
if (*context_ptr == NULL) {
@@ -216,14 +215,14 @@ void clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, v
}
}
void clock_face_activate(movement_settings_t *settings, void *context) {
void clock_face_activate(void *context) {
clock_state_t *clock = (clock_state_t *) context;
clock_stop_tick_tock_animation();
clock_indicate_time_signal(clock);
clock_indicate_alarm(settings);
clock_indicate_24h(settings);
clock_indicate_alarm();
clock_indicate_24h();
watch_set_colon();
@@ -231,7 +230,7 @@ void clock_face_activate(movement_settings_t *settings, void *context) {
clock->date_time.previous.reg = 0xFFFFFFFF;
}
bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
bool clock_face_loop(movement_event_t event, void *context) {
clock_state_t *state = (clock_state_t *) context;
watch_date_time current;
@@ -244,7 +243,7 @@ bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void
case EVENT_ACTIVATE:
current = watch_rtc_get_date_time();
clock_display_clock(settings, state, current);
clock_display_clock(state, current);
clock_check_battery_periodically(state, current);
@@ -260,19 +259,17 @@ bool clock_face_loop(movement_event_t event, movement_settings_t *settings, void
movement_play_signal();
break;
default:
return movement_default_loop_handler(event, settings);
return movement_default_loop_handler(event);
}
return true;
}
void clock_face_resign(movement_settings_t *settings, void *context) {
(void) settings;
void clock_face_resign(void *context) {
(void) context;
}
bool clock_face_wants_background_task(movement_settings_t *settings, void *context) {
(void) settings;
bool clock_face_wants_background_task(void *context) {
clock_state_t *state = (clock_state_t *) context;
if (!state->time_signal_enabled) return false;

View File

@@ -43,11 +43,11 @@
#include "movement.h"
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);
void clock_face_resign(movement_settings_t *settings, void *context);
bool clock_face_wants_background_task(movement_settings_t *settings, void *context);
void clock_face_setup(uint8_t watch_face_index, void ** context_ptr);
void clock_face_activate(void *context);
bool clock_face_loop(movement_event_t event, void *context);
void clock_face_resign(void *context);
bool clock_face_wants_background_task(void *context);
#define clock_face ((const watch_face_t) { \
clock_face_setup, \

View File

@@ -34,8 +34,7 @@ static void _update_alarm_indicator(bool settings_alarm_enabled, simple_clock_st
else watch_clear_indicator(WATCH_INDICATOR_SIGNAL);
}
void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
(void) settings;
void simple_clock_face_setup(uint8_t watch_face_index, void ** context_ptr) {
(void) watch_face_index;
if (*context_ptr == NULL) {
@@ -46,7 +45,7 @@ void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_i
}
}
void simple_clock_face_activate(movement_settings_t *settings, void *context) {
void simple_clock_face_activate(void *context) {
simple_clock_state_t *state = (simple_clock_state_t *)context;
if (watch_tick_animation_is_running()) watch_stop_tick_animation();
@@ -66,7 +65,7 @@ void simple_clock_face_activate(movement_settings_t *settings, void *context) {
state->previous_date_time = 0xFFFFFFFF;
}
bool simple_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
bool simple_clock_face_loop(movement_event_t event, void *context) {
simple_clock_state_t *state = (simple_clock_state_t *)context;
char buf[11];
@@ -143,19 +142,17 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
movement_play_signal();
break;
default:
return movement_default_loop_handler(event, settings);
return movement_default_loop_handler(event);
}
return true;
}
void simple_clock_face_resign(movement_settings_t *settings, void *context) {
(void) settings;
void simple_clock_face_resign(void *context) {
(void) context;
}
bool simple_clock_face_wants_background_task(movement_settings_t *settings, void *context) {
(void) settings;
bool simple_clock_face_wants_background_task(void *context) {
simple_clock_state_t *state = (simple_clock_state_t *)context;
if (!state->signal_enabled) return false;

View File

@@ -45,11 +45,11 @@ typedef struct {
bool alarm_enabled;
} simple_clock_state_t;
void simple_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, 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);
bool simple_clock_face_wants_background_task(movement_settings_t *settings, void *context);
void simple_clock_face_setup(uint8_t watch_face_index, void ** context_ptr);
void simple_clock_face_activate(void *context);
bool simple_clock_face_loop(movement_event_t event, void *context);
void simple_clock_face_resign(void *context);
bool simple_clock_face_wants_background_task(void *context);
#define simple_clock_face ((const watch_face_t){ \
simple_clock_face_setup, \

View File

@@ -35,8 +35,7 @@ void _update_timezone_offset(world_clock_state_t *state) {
state->current_offset = movement_get_current_timezone_offset_for_zone(state->settings.bit.timezone_index);
}
void world_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
(void) settings;
void world_clock_face_setup(uint8_t watch_face_index, void ** context_ptr) {
(void) watch_face_index;
if (*context_ptr == NULL) {
*context_ptr = malloc(sizeof(world_clock_state_t));
@@ -51,8 +50,7 @@ void world_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_in
}
}
void world_clock_face_activate(movement_settings_t *settings, void *context) {
(void) settings;
void world_clock_face_activate(void *context) {
world_clock_state_t *state = (world_clock_state_t *)context;
state->current_screen = 0;
@@ -61,7 +59,7 @@ void world_clock_face_activate(movement_settings_t *settings, void *context) {
if (watch_tick_animation_is_running()) watch_stop_tick_animation();
}
static bool world_clock_face_do_display_mode(movement_event_t event, movement_settings_t *settings, world_clock_state_t *state) {
static bool world_clock_face_do_display_mode(movement_event_t event, world_clock_state_t *state) {
char buf[11];
uint32_t previous_date_time;
@@ -121,13 +119,13 @@ static bool world_clock_face_do_display_mode(movement_event_t event, movement_se
state->current_screen = 1;
break;
default:
return movement_default_loop_handler(event, settings);
return movement_default_loop_handler(event);
}
return true;
}
static bool _world_clock_face_do_settings_mode(movement_event_t event, movement_settings_t *settings, world_clock_state_t *state) {
static bool _world_clock_face_do_settings_mode(movement_event_t event, world_clock_state_t *state) {
switch (event.event_type) {
case EVENT_MODE_BUTTON_UP:
if (state->backup_register) watch_store_backup_data(state->settings.reg, state->backup_register);
@@ -141,7 +139,7 @@ static bool _world_clock_face_do_settings_mode(movement_event_t event, movement_
state->current_screen = 0;
if (state->backup_register) watch_store_backup_data(state->settings.reg, state->backup_register);
event.event_type = EVENT_ACTIVATE;
return world_clock_face_do_display_mode(event, settings, state);
return world_clock_face_do_display_mode(event, state);
}
break;
case EVENT_ALARM_BUTTON_DOWN:
@@ -198,17 +196,16 @@ static bool _world_clock_face_do_settings_mode(movement_event_t event, movement_
return true;
}
bool world_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
bool world_clock_face_loop(movement_event_t event, void *context) {
world_clock_state_t *state = (world_clock_state_t *)context;
if (state->current_screen == 0) {
return world_clock_face_do_display_mode(event, settings, state);
return world_clock_face_do_display_mode(event, state);
} else {
return _world_clock_face_do_settings_mode(event, settings, state);
return _world_clock_face_do_settings_mode(event, state);
}
}
void world_clock_face_resign(movement_settings_t *settings, void *context) {
(void) settings;
void world_clock_face_resign(void *context) {
(void) context;
}

View File

@@ -65,10 +65,10 @@ typedef struct {
int32_t current_offset;
} world_clock_state_t;
void world_clock_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
void world_clock_face_activate(movement_settings_t *settings, void *context);
bool world_clock_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void world_clock_face_resign(movement_settings_t *settings, void *context);
void world_clock_face_setup(uint8_t watch_face_index, void ** context_ptr);
void world_clock_face_activate(void *context);
bool world_clock_face_loop(movement_event_t event, void *context);
void world_clock_face_resign(void *context);
uint8_t world_clock_face_get_weekday(uint16_t day, uint16_t month, uint16_t year);

View File

@@ -59,14 +59,13 @@ static inline void load_countdown(countdown_state_t *state) {
state->seconds = state->set_seconds;
}
static inline void button_beep(movement_settings_t *settings) {
static inline void button_beep() {
// play a beep as confirmation for a button press (if applicable)
if (movement_button_should_sound())
watch_buzzer_play_note(BUZZER_NOTE_C7, 50);
}
static void schedule_countdown(countdown_state_t *state, movement_settings_t *settings) {
(void) settings;
static void schedule_countdown(countdown_state_t *state) {
// Calculate the new state->now_ts but don't update it until we've updated the target -
// avoid possible race where the old target is compared to the new time and immediately triggers
@@ -77,15 +76,15 @@ static void schedule_countdown(countdown_state_t *state, movement_settings_t *se
movement_schedule_background_task_for_face(state->watch_face_index, target_dt);
}
static void auto_repeat(countdown_state_t *state, movement_settings_t *settings) {
static void auto_repeat(countdown_state_t *state) {
movement_play_alarm();
load_countdown(state);
schedule_countdown(state, settings);
schedule_countdown(state);
}
static void start(countdown_state_t *state, movement_settings_t *settings) {
static void start(countdown_state_t *state) {
state->mode = cd_running;
schedule_countdown(state, settings);
schedule_countdown(state);
}
@@ -153,9 +152,9 @@ static void ring(countdown_state_t *state) {
reset(state);
}
static void times_up(movement_settings_t *settings, countdown_state_t *state) {
static void times_up(countdown_state_t *state) {
if(state->repeat) {
auto_repeat(state, settings);
auto_repeat(state);
}
else {
ring(state);
@@ -180,8 +179,7 @@ static void settings_increment(countdown_state_t *state) {
return;
}
void countdown_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
(void) settings;
void countdown_face_setup(uint8_t watch_face_index, void ** context_ptr) {
(void) watch_face_index;
if (*context_ptr == NULL) {
@@ -195,8 +193,7 @@ void countdown_face_setup(movement_settings_t *settings, uint8_t watch_face_inde
}
}
void countdown_face_activate(movement_settings_t *settings, void *context) {
(void) settings;
void countdown_face_activate(void *context) {
countdown_state_t *state = (countdown_state_t *)context;
if(state->mode == cd_running) {
watch_date_time now = watch_rtc_get_date_time();
@@ -211,8 +208,7 @@ void countdown_face_activate(movement_settings_t *settings, void *context) {
quick_ticks_running = false;
}
bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
(void) settings;
bool countdown_face_loop(movement_event_t event, void *context) {
countdown_state_t *state = (countdown_state_t *)context;
switch (event.event_type) {
@@ -244,7 +240,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
break;
case cd_paused:
reset(state);
button_beep(settings);
button_beep();
break;
case cd_setting:
state->selection++;
@@ -253,7 +249,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
state->mode = cd_reset;
store_countdown(state);
movement_request_tick_frequency(1);
button_beep(settings);
button_beep();
}
break;
}
@@ -263,14 +259,14 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
switch(state->mode) {
case cd_running:
pause(state);
button_beep(settings);
button_beep();
break;
case cd_reset:
case cd_paused:
if (!(state->hours == 0 && state->minutes == 0 && state->seconds == 0)) {
// Only start the timer if we have a valid time.
start(state, settings);
button_beep(settings);
start(state);
button_beep();
watch_set_indicator(WATCH_INDICATOR_SIGNAL);
}
break;
@@ -286,7 +282,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
// long press in reset mode enters settings
state->mode = cd_setting;
movement_request_tick_frequency(4);
button_beep(settings);
button_beep();
break;
case cd_setting:
// long press in settings mode starts quick ticks for adjusting the time
@@ -314,7 +310,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
}
} else {
// Toggle auto-repeat
button_beep(settings);
button_beep();
state->repeat = !state->repeat;
if(state->repeat)
watch_set_indicator(WATCH_INDICATOR_BELL);
@@ -326,7 +322,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
abort_quick_ticks(state);
break;
case EVENT_BACKGROUND_TASK:
times_up(settings, state);
times_up(state);
break;
case EVENT_TIMEOUT:
if (state->mode == cd_setting) {
@@ -334,7 +330,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
state->mode = cd_reset;
store_countdown(state);
movement_request_tick_frequency(1);
button_beep(settings);
button_beep();
}
break;
case EVENT_LOW_ENERGY_UPDATE:
@@ -342,15 +338,14 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
// intentionally squelch the light default event; we only show the light when cd is running or reset
break;
default:
movement_default_loop_handler(event, settings);
movement_default_loop_handler(event);
break;
}
return true;
}
void countdown_face_resign(movement_settings_t *settings, void *context) {
(void) settings;
void countdown_face_resign(void *context) {
countdown_state_t *state = (countdown_state_t *)context;
if (state->mode == cd_setting) {
state->selection = 0;

View File

@@ -67,10 +67,10 @@ typedef struct {
} countdown_state_t;
void countdown_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
void countdown_face_activate(movement_settings_t *settings, void *context);
bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void countdown_face_resign(movement_settings_t *settings, void *context);
void countdown_face_setup(uint8_t watch_face_index, void ** context_ptr);
void countdown_face_activate(void *context);
bool countdown_face_loop(movement_event_t event, void *context);
void countdown_face_resign(void *context);
#define countdown_face ((const watch_face_t){ \
countdown_face_setup, \

View File

@@ -37,8 +37,7 @@ const char preferences_face_titles[PREFERENCES_PAGE_NUM_PREFERENCES][11] = {
"LT blue ", // Light: blue component (for watches with blue LED)
};
void preferences_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
(void) settings;
void preferences_face_setup(uint8_t watch_face_index, void ** context_ptr) {
(void) watch_face_index;
if (*context_ptr == NULL) {
*context_ptr = malloc(sizeof(preferences_state_t));
@@ -62,14 +61,13 @@ void preferences_face_setup(movement_settings_t *settings, uint8_t watch_face_in
}
}
void preferences_face_activate(movement_settings_t *settings, void *context) {
(void) settings;
void preferences_face_activate(void *context) {
preferences_state_t *state = (preferences_state_t *)context;
state->current_page = 0;
movement_request_tick_frequency(4); // we need to manually blink some pixels
}
bool preferences_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
bool preferences_face_loop(movement_event_t event, void *context) {
preferences_state_t *state = (preferences_state_t *)context;
movement_color_t color; // to use in the switch if we need it
@@ -225,7 +223,7 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings
movement_move_to_face(0);
break;
default:
return movement_default_loop_handler(event, settings);
return movement_default_loop_handler(event);
}
if (state->current_page == PREFERENCES_PAGE_LED_RED ||
@@ -243,8 +241,7 @@ bool preferences_face_loop(movement_event_t event, movement_settings_t *settings
}
}
void preferences_face_resign(movement_settings_t *settings, void *context) {
(void) settings;
void preferences_face_resign(void *context) {
(void) context;
movement_force_led_off();
movement_store_settings();

View File

@@ -99,10 +99,10 @@ typedef struct {
preferences_page_t current_page;
} preferences_state_t;
void preferences_face_setup(movement_settings_t *settings, uint8_t watch_face_index, 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);
void preferences_face_setup(uint8_t watch_face_index, void ** context_ptr);
void preferences_face_activate(void *context);
bool preferences_face_loop(movement_event_t event, void *context);
void preferences_face_resign(void *context);
#define preferences_face ((const watch_face_t){ \
preferences_face_setup, \

View File

@@ -34,7 +34,7 @@ const char set_time_face_titles[SET_TIME_FACE_NUM_SETTINGS][3] = {"HR", "M1", "S
static bool _quick_ticks_running;
static void _handle_alarm_button(movement_settings_t *settings, watch_date_time date_time, uint8_t current_page) {
static void _handle_alarm_button(watch_date_time date_time, uint8_t current_page) {
// handles short or long pressing of the alarm button
switch (current_page) {
@@ -74,27 +74,25 @@ static void _abort_quick_ticks() {
}
}
void set_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
(void) settings;
void set_time_face_setup(uint8_t watch_face_index, void ** context_ptr) {
(void) watch_face_index;
if (*context_ptr == NULL) *context_ptr = malloc(sizeof(uint8_t));
}
void set_time_face_activate(movement_settings_t *settings, void *context) {
(void) settings;
void set_time_face_activate(void *context) {
*((uint8_t *)context) = 0;
movement_request_tick_frequency(4);
_quick_ticks_running = false;
}
bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
bool set_time_face_loop(movement_event_t event, void *context) {
uint8_t current_page = *((uint8_t *)context);
watch_date_time date_time = watch_rtc_get_date_time();
switch (event.event_type) {
case EVENT_TICK:
if (_quick_ticks_running) {
if (HAL_GPIO_BTN_ALARM_read()) _handle_alarm_button(settings, date_time, current_page);
if (HAL_GPIO_BTN_ALARM_read()) _handle_alarm_button(date_time, current_page);
else _abort_quick_ticks();
}
break;
@@ -117,14 +115,14 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v
break;
case EVENT_ALARM_BUTTON_UP:
_abort_quick_ticks();
_handle_alarm_button(settings, date_time, current_page);
_handle_alarm_button(date_time, current_page);
break;
case EVENT_TIMEOUT:
_abort_quick_ticks();
movement_move_to_face(0);
break;
default:
return movement_default_loop_handler(event, settings);
return movement_default_loop_handler(event);
}
char buf[11];
@@ -178,8 +176,7 @@ bool set_time_face_loop(movement_event_t event, movement_settings_t *settings, v
return true;
}
void set_time_face_resign(movement_settings_t *settings, void *context) {
(void) settings;
void set_time_face_resign(void *context) {
(void) context;
watch_set_led_off();
movement_store_settings();

View File

@@ -44,10 +44,10 @@
#include "movement.h"
void set_time_face_setup(movement_settings_t *settings, uint8_t watch_face_index, 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);
void set_time_face_setup(uint8_t watch_face_index, void ** context_ptr);
void set_time_face_activate(void *context);
bool set_time_face_loop(movement_event_t event, void *context);
void set_time_face_resign(void *context);
#define set_time_face ((const watch_face_t){ \
set_time_face_setup, \