refactor: watch faces no longer need a pointer to settings!
This commit is contained in:
@@ -157,12 +157,11 @@ static void totp_generate_and_display(totp_state_t *totp_state) {
|
||||
totp_display(totp_state);
|
||||
}
|
||||
|
||||
static inline uint32_t totp_compute_base_timestamp(movement_settings_t *settings) {
|
||||
static inline uint32_t totp_compute_base_timestamp() {
|
||||
return watch_utility_date_time_to_unix_time(watch_rtc_get_date_time(), movement_get_current_timezone_offset());
|
||||
}
|
||||
|
||||
void totp_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) settings;
|
||||
void totp_face_setup(uint8_t watch_face_index, void ** context_ptr) {
|
||||
(void) watch_face_index;
|
||||
|
||||
totp_validate_key_lengths();
|
||||
@@ -174,12 +173,11 @@ void totp_face_setup(movement_settings_t *settings, uint8_t watch_face_index, vo
|
||||
}
|
||||
}
|
||||
|
||||
void totp_face_activate(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void totp_face_activate(void *context) {
|
||||
|
||||
totp_state_t *totp = (totp_state_t *) context;
|
||||
|
||||
totp->timestamp = totp_compute_base_timestamp(settings);
|
||||
totp->timestamp = totp_compute_base_timestamp();
|
||||
totp->steps = 0;
|
||||
totp->current_code = 0;
|
||||
totp->current_index = 0;
|
||||
@@ -189,8 +187,7 @@ void totp_face_activate(movement_settings_t *settings, void *context) {
|
||||
totp_generate_and_display(totp);
|
||||
}
|
||||
|
||||
bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
bool totp_face_loop(movement_event_t event, void *context) {
|
||||
|
||||
totp_state_t *totp_state = (totp_state_t *) context;
|
||||
|
||||
@@ -234,14 +231,13 @@ bool totp_face_loop(movement_event_t event, movement_settings_t *settings, void
|
||||
movement_illuminate_led();
|
||||
break;
|
||||
default:
|
||||
movement_default_loop_handler(event, settings);
|
||||
movement_default_loop_handler(event);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void totp_face_resign(movement_settings_t *settings, void *context) {
|
||||
(void) settings;
|
||||
void totp_face_resign(void *context) {
|
||||
(void) context;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user