diff options
author | joeycastillo <joeycastillo@utexas.edu> | 2022-01-19 09:15:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-19 09:15:47 -0500 |
commit | 1ae83e8fd48d59addf5f238cb28134a03f4ecc63 (patch) | |
tree | 2e7095c15377234b0679cfb14d30e0e7ffdfb908 | |
parent | 903ae6eff89540b21910e06ef4abbb87e5c510c7 (diff) | |
parent | 01df0ea231f48f536176ab7088bff7ba73cb89b8 (diff) | |
download | Sensor-Watch-1ae83e8fd48d59addf5f238cb28134a03f4ecc63.tar.gz Sensor-Watch-1ae83e8fd48d59addf5f238cb28134a03f4ecc63.tar.bz2 Sensor-Watch-1ae83e8fd48d59addf5f238cb28134a03f4ecc63.zip |
Merge pull request #37 from davidskeck/patch-2
Countdown: Added ability to reset to default timer value
-rw-r--r-- | movement/watch_faces/complications/countdown_face.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/movement/watch_faces/complications/countdown_face.c b/movement/watch_faces/complications/countdown_face.c index 16e06ac9..99eb1243 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_setting) { + state->minutes = DEFAULT_MINUTES; + state->seconds = 0; + draw(state, event.subsecond); + break; + } break; case EVENT_TIMEOUT: movement_move_to_face(0); |