]> git.earman.xyz Git - sensor-watch.git/commitdiff
Make countdown face reset to 0 (#90)
authorJames Haggerty <james@gruemail.com>
Sat, 29 Oct 2022 22:01:05 +0000 (09:01 +1100)
committerGitHub <noreply@github.com>
Sat, 29 Oct 2022 22:01:05 +0000 (17:01 -0500)
* 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

movement/watch_faces/complication/countdown_face.c

index 81836f37d7c7c42626f5613f805d9d86564983aa..ee523b41bf9cca692abea54a4d7a8e296d104719 100644 (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;