summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--movement/movement.c20
-rw-r--r--movement/movement.h1
-rw-r--r--movement/watch_faces/clock/repetition_minute_face.c14
-rw-r--r--movement/watch_faces/clock/simple_clock_bin_led_face.c12
-rw-r--r--movement/watch_faces/clock/simple_clock_face.c16
-rw-r--r--movement/watch_faces/clock/weeknumber_clock_face.c12
6 files changed, 28 insertions, 47 deletions
diff --git a/movement/movement.c b/movement/movement.c
index 0c6ed319..f0868416 100644
--- a/movement/movement.c
+++ b/movement/movement.c
@@ -294,7 +294,25 @@ void movement_request_wake() {
}
void movement_play_signal(void) {
- watch_buzzer_play_sequence(signal_tune, NULL);
+ 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);
+ }
}
void movement_play_alarm(void) {
diff --git a/movement/movement.h b/movement/movement.h
index 66bf6af4..5f30dfb8 100644
--- a/movement/movement.h
+++ b/movement/movement.h
@@ -307,6 +307,7 @@ void movement_cancel_background_task_for_face(uint8_t watch_face_index);
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);
diff --git a/movement/watch_faces/clock/repetition_minute_face.c b/movement/watch_faces/clock/repetition_minute_face.c
index a0fbe077..fc78b2d8 100644
--- a/movement/watch_faces/clock/repetition_minute_face.c
+++ b/movement/watch_faces/clock/repetition_minute_face.c
@@ -151,19 +151,7 @@ bool repetition_minute_face_loop(movement_event_t event, movement_settings_t *se
else watch_clear_indicator(WATCH_INDICATOR_BELL);
break;
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);
- 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();
- }
+ movement_play_signal();
break;
case EVENT_LIGHT_LONG_UP:
/*
diff --git a/movement/watch_faces/clock/simple_clock_bin_led_face.c b/movement/watch_faces/clock/simple_clock_bin_led_face.c
index 640f0d77..cf39c188 100644
--- a/movement/watch_faces/clock/simple_clock_bin_led_face.c
+++ b/movement/watch_faces/clock/simple_clock_bin_led_face.c
@@ -180,17 +180,7 @@ bool simple_clock_bin_led_face_loop(movement_event_t event, movement_settings_t
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);
- 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();
- }
+ movement_play_signal();
break;
case EVENT_LIGHT_LONG_PRESS:
if (state->flashing_state == 0) {
diff --git a/movement/watch_faces/clock/simple_clock_face.c b/movement/watch_faces/clock/simple_clock_face.c
index 91400b6c..ac9a97b2 100644
--- a/movement/watch_faces/clock/simple_clock_face.c
+++ b/movement/watch_faces/clock/simple_clock_face.c
@@ -136,17 +136,11 @@ bool simple_clock_face_loop(movement_event_t event, movement_settings_t *setting
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);
- 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();
- }
+ #ifdef SIGNAL_TUNE_DEFAULT
+ movement_play_signal();
+ #else
+ movement_play_tune();
+ #endif
break;
default:
return movement_default_loop_handler(event, settings);
diff --git a/movement/watch_faces/clock/weeknumber_clock_face.c b/movement/watch_faces/clock/weeknumber_clock_face.c
index 4e40ebdc..81df5847 100644
--- a/movement/watch_faces/clock/weeknumber_clock_face.c
+++ b/movement/watch_faces/clock/weeknumber_clock_face.c
@@ -130,17 +130,7 @@ bool weeknumber_clock_face_loop(movement_event_t event, movement_settings_t *set
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);
- 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();
- }
+ movement_play_signal();
break;
default:
movement_default_loop_handler(event, settings);