From 3d5ec1adda827060e9049a21adf4aff79de0ee48 Mon Sep 17 00:00:00 2001 From: David Keck Date: Tue, 18 Jan 2022 22:29:04 -0500 Subject: Added ability to reset to default timer value Added option to reset to the default timer value when in waiting mode and on long press of alarm. This was useful to me as I sometimes accidentally increase the timer value and then would need to loop around to get back to the default value. --- movement/watch_faces/complications/countdown_face.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/movement/watch_faces/complications/countdown_face.c b/movement/watch_faces/complications/countdown_face.c index 16e06ac9..c122c502 100644 --- a/movement/watch_faces/complications/countdown_face.c +++ b/movement/watch_faces/complications/countdown_face.c @@ -32,6 +32,7 @@ #define CD_SELECTIONS 2 +#define DEFAULT_MINUTES 3 static uint32_t offset_date_time(uint32_t now, int8_t hours, int8_t minutes, int8_t seconds) { @@ -129,7 +130,7 @@ void countdown_face_setup(movement_settings_t *settings, uint8_t watch_face_inde *context_ptr = malloc(sizeof(countdown_state_t)); countdown_state_t *state = (countdown_state_t *)*context_ptr; memset(*context_ptr, 0, sizeof(countdown_state_t)); - state->minutes = 3; + state->minutes = DEFAULT_MINUTES; } } @@ -198,6 +199,12 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, ring(state); break; case EVENT_ALARM_LONG_PRESS: + if (state->mode == cd_waiting) { + state->minutes = DEFAULT_MINUTES; + state->seconds = 0; + draw(state, event.subsecond); + break; + } break; case EVENT_TIMEOUT: movement_move_to_face(0); -- cgit v1.2.3 From 01df0ea231f48f536176ab7088bff7ba73cb89b8 Mon Sep 17 00:00:00 2001 From: David Keck Date: Tue, 18 Jan 2022 22:53:25 -0500 Subject: Changed reset mode to setting instead of waiting After thinking about this, I think it is more intuitive that this would only apply when in setting mode. --- movement/watch_faces/complications/countdown_face.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/movement/watch_faces/complications/countdown_face.c b/movement/watch_faces/complications/countdown_face.c index c122c502..99eb1243 100644 --- a/movement/watch_faces/complications/countdown_face.c +++ b/movement/watch_faces/complications/countdown_face.c @@ -199,7 +199,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings, ring(state); break; case EVENT_ALARM_LONG_PRESS: - if (state->mode == cd_waiting) { + if (state->mode == cd_setting) { state->minutes = DEFAULT_MINUTES; state->seconds = 0; draw(state, event.subsecond); -- cgit v1.2.3