]> git.earman.xyz Git - sensor-watch.git/commitdiff
Merge branch 'main' into default-handler
authorjoeycastillo <joeycastillo@utexas.edu>
Tue, 17 Jan 2023 16:52:42 +0000 (10:52 -0600)
committerjoeycastillo <joeycastillo@utexas.edu>
Tue, 17 Jan 2023 16:52:42 +0000 (10:52 -0600)
1  2 
movement/watch_faces/clock/simple_clock_face.c

index fbc2c4b3ea71aefb8b32615b8c413e1cd2c8a0f5,179b23d60f480fb9f23ee6932b5d15c2ff7233a7..91400b6c316b51ae081cb0424d5cb68363c0072c
@@@ -136,10 -142,20 +136,20 @@@ bool simple_clock_face_loop(movement_ev
          case EVENT_BACKGROUND_TASK:
              // uncomment this line to snap back to the clock face when the hour signal sounds:
              // movement_move_to_face(state->watch_face_index);
-             movement_play_signal();
+             if (watch_is_buzzer_or_led_enabled()) {
+                 // if we are in the foreground, we can just beep.
+                 movement_play_signal();
+             } else {
+                 // if we were in the background, we need to enable the buzzer peripheral first,
+                 watch_enable_buzzer();
+                 // beep quickly (this call blocks for 275 ms),
+                 movement_play_signal();
+                 // and then turn the buzzer peripheral off again.
+                 watch_disable_buzzer();
+             }
              break;
          default:
 -            break;
 +            return movement_default_loop_handler(event, settings);
      }
  
      return true;