]> git.earman.xyz Git - sensor-watch.git/commitdiff
make stopwatch beep when started/stopped
authorjoeycastillo <joeycastillo@utexas.edu>
Sun, 27 Nov 2022 22:52:25 +0000 (16:52 -0600)
committerjoeycastillo <joeycastillo@utexas.edu>
Sun, 27 Nov 2022 22:52:25 +0000 (16:52 -0600)
movement/watch_faces/complication/stopwatch_face.c

index e85bbd65f62f95b753059b933bbe8fa6067ca97f..5a465183c656cae53bafa5f1da4a7235744e9df2 100644 (file)
@@ -77,7 +77,6 @@ void stopwatch_face_activate(movement_settings_t *settings, void *context) {
 }
 
 bool stopwatch_face_loop(movement_event_t event, movement_settings_t *settings, void *context) {
-    (void) settings;
     stopwatch_state_t *stopwatch_state = (stopwatch_state_t *)context;
 
     switch (event.event_type) {
@@ -103,6 +102,9 @@ bool stopwatch_face_loop(movement_event_t event, movement_settings_t *settings,
             }
             break;
         case EVENT_ALARM_BUTTON_DOWN:
+            if (settings->bit.button_should_sound) {
+                watch_buzzer_play_note(BUZZER_NOTE_C8, 50);
+            }
             stopwatch_state->running = !stopwatch_state->running;
             if (stopwatch_state->running) {
                 // we're running now, so we need to set the start_time.