refactor: watch faces no longer need a pointer to settings!
This commit is contained in:
@@ -34,20 +34,18 @@ char set_time_hackwatch_face_titles[][3] = {"HR", "M1", "SE", "YR", "MO", "DA",
|
||||
|
||||
watch_date_time date_time_settings;
|
||||
|
||||
void set_time_hackwatch_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
void set_time_hackwatch_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_hackwatch_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void set_time_hackwatch_face_activate(void *context) {
|
||||
*((uint8_t *)context) = 3;
|
||||
movement_request_tick_frequency(32);
|
||||
date_time_settings = watch_rtc_get_date_time();
|
||||
}
|
||||
|
||||
bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
bool set_time_hackwatch_face_loop(movement_event_t event, void *context) {
|
||||
uint8_t current_page = *((uint8_t *)context);
|
||||
|
||||
if (event.subsecond == 15) // Delay displayed time update by ~0.5 seconds, to align phase exactly to main clock at 1Hz
|
||||
@@ -185,7 +183,7 @@ bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *s
|
||||
// don't light up every time light is hit
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
movement_default_loop_handler(event);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -263,8 +261,7 @@ bool set_time_hackwatch_face_loop(movement_event_t event, movement_settings_t *s
|
||||
return true;
|
||||
}
|
||||
|
||||
void set_time_hackwatch_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void set_time_hackwatch_face_resign(void *context) {
|
||||
(void) context;
|
||||
watch_set_led_off();
|
||||
movement_store_settings();
|
||||
|
||||
Reference in New Issue
Block a user