]> git.earman.xyz Git - sensor-watch.git/commitdiff
countdown_face: implement holding light to reset the currently edited timer value...
authorJeremy O'Brien <neutral@fastmail.com>
Thu, 26 Jan 2023 14:56:37 +0000 (09:56 -0500)
committerjoeycastillo <joeycastillo@utexas.edu>
Fri, 10 Feb 2023 22:31:24 +0000 (16:31 -0600)
movement/watch_faces/complication/countdown_face.c

index 4c3859da316f604f43a8b65016bc744bafa91ebd..958a5737351f71de36ef8b6435372dc6c60f1c17 100644 (file)
@@ -278,6 +278,21 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
                 movement_request_tick_frequency(8);
             }
             break;
+        case EVENT_LIGHT_LONG_PRESS:
+            if (state->mode == cd_setting) {
+                switch (state->selection) {
+                    case 0:
+                        state->hours = 0;
+                        // intentional fallthrough
+                    case 1:
+                        state->minutes = 0;
+                        // intentional fallthrough
+                    case 2:
+                        state->seconds = 0;
+                        break;
+                }
+            }
+            break;
         case EVENT_ALARM_LONG_UP:
             abort_quick_ticks(state);
             break;
@@ -289,6 +304,8 @@ bool countdown_face_loop(movement_event_t event, movement_settings_t *settings,
             movement_move_to_face(0);
             break;
         case EVENT_LOW_ENERGY_UPDATE:
+        // intentionally squelch the light default event; we only show the light when cd is running
+        case EVENT_LIGHT_BUTTON_DOWN:
             break;
         default:
             movement_default_loop_handler(event, settings);