Fix faces that relied on watch_buzzer_play_note being blocking
This commit is contained in:
@@ -202,9 +202,16 @@ static void _alarm_update_alarm_enabled(alarm_state_t *state) {
|
||||
|
||||
static void _alarm_play_short_beep(uint8_t pitch_idx) {
|
||||
// play a short double beep
|
||||
watch_buzzer_play_note(_buzzer_notes[pitch_idx], 50);
|
||||
watch_buzzer_play_note(BUZZER_NOTE_REST, 50);
|
||||
watch_buzzer_play_note(_buzzer_notes[pitch_idx], 70);
|
||||
static int8_t beep_sequence[] = {
|
||||
0, 4,
|
||||
BUZZER_NOTE_REST, 4,
|
||||
0, 6,
|
||||
0
|
||||
};
|
||||
beep_sequence[0] = _buzzer_notes[pitch_idx];
|
||||
beep_sequence[4] = _buzzer_notes[pitch_idx];
|
||||
|
||||
movement_play_sequence(beep_sequence, 0);
|
||||
}
|
||||
|
||||
static void _alarm_indicate_beep(alarm_state_t *state) {
|
||||
@@ -437,14 +444,7 @@ bool advanced_alarm_face_loop(movement_event_t event, void *context) {
|
||||
// play alarm
|
||||
if (state->alarm[state->alarm_playing_idx].beeps == 0) {
|
||||
// short beep
|
||||
if (watch_is_buzzer_or_led_enabled()) {
|
||||
_alarm_play_short_beep(state->alarm[state->alarm_playing_idx].pitch);
|
||||
} else {
|
||||
// enable, play beep and disable buzzer again
|
||||
watch_enable_buzzer();
|
||||
_alarm_play_short_beep(state->alarm[state->alarm_playing_idx].pitch);
|
||||
watch_disable_buzzer();
|
||||
}
|
||||
_alarm_play_short_beep(state->alarm[state->alarm_playing_idx].pitch);
|
||||
} else {
|
||||
// regular alarm beeps
|
||||
movement_play_alarm_beeps((state->alarm[state->alarm_playing_idx].beeps == (ALARM_MAX_BEEP_ROUNDS - 1) ? 20 : state->alarm[state->alarm_playing_idx].beeps),
|
||||
|
||||
Reference in New Issue
Block a user