Make countdown face reset to 0 (#90)

* Make countdown face reset to 0

It was annoying to have countdowns less than DEFAULT_MINUTES.
Admittedly, this does make DEFAULT_MINUTES fairly useless, since
we only ever see it the first time...

* Undo accidental change to movement_config.h
This commit is contained in:
James Haggerty 2022-10-30 09:01:05 +11:00 committed by GitHub
parent cb69a2c181
commit d994ce8b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,10 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
reset(state);
break;
case cd_waiting:
start(state, settings);
if (!(state->minutes == 0 && state->seconds == 0)) {
// Only start the timer if we have a valid time.
start(state, settings);
}
break;
case cd_setting:
settings_increment(state);
@ -192,7 +195,7 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
break;
case EVENT_ALARM_LONG_PRESS:
if (state->mode == cd_setting) {
state->minutes = DEFAULT_MINUTES;
state->minutes = 0;
state->seconds = 0;
draw(state, event.subsecond);
break;