}
void movement_play_signal(void) {
- bool buzzer_enabled = watch_is_buzzer_or_led_enabled();
- if (!buzzer_enabled) {
- watch_enable_buzzer();
- }
- watch_buzzer_play_note(BUZZER_NOTE_C8, 75);
- watch_buzzer_play_note(BUZZER_NOTE_REST, 100);
- watch_buzzer_play_note(BUZZER_NOTE_C8, 100);
- if (!buzzer_enabled) {
- watch_disable_buzzer();
- }
-}
-
-void movement_play_tune(void) {
- if (!watch_is_buzzer_or_led_enabled()) {
- watch_enable_buzzer();
- watch_buzzer_play_sequence(signal_tune, watch_disable_buzzer);
- } else {
- watch_buzzer_play_sequence(signal_tune, NULL);
- }
+ watch_buzzer_play_sequence(signal_tune, NULL);
}
void movement_play_alarm(void) {
void movement_request_wake(void);
void movement_play_signal(void);
-void movement_play_tune(void);
void movement_play_alarm(void);
void movement_play_alarm_beeps(uint8_t rounds, BuzzerNote alarm_note);
else watch_clear_indicator(WATCH_INDICATOR_BELL);
break;
case EVENT_BACKGROUND_TASK:
- movement_play_signal();
+ // uncomment this line to snap back to the clock face when the hour signal sounds:
+ // movement_move_to_face(state->watch_face_index);
+ 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;
case EVENT_LIGHT_LONG_UP:
/*
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;
case EVENT_LIGHT_LONG_PRESS:
if (state->flashing_state == 0) {
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);
- #ifdef SIGNAL_TUNE_DEFAULT
- movement_play_signal();
- #else
- movement_play_tune();
- #endif
+ 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:
return movement_default_loop_handler(event, settings);
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:
movement_default_loop_handler(event, settings);