// The note sequence of the default alarm
int8_t alarm_tune[] = {
BUZZER_NOTE_C8, 4,
- BUZZER_NOTE_REST, 4,
+ BUZZER_NOTE_REST, 7,
BUZZER_NOTE_C8, 4,
- BUZZER_NOTE_REST, 4,
+ BUZZER_NOTE_REST, 7,
BUZZER_NOTE_C8, 4,
- BUZZER_NOTE_REST, 4,
- BUZZER_NOTE_C8, 6,
- BUZZER_NOTE_REST, 18,
+ BUZZER_NOTE_REST, 7,
+ BUZZER_NOTE_C8, 4,
+ BUZZER_NOTE_REST, 27,
-8, 9,
0
};
static int8_t single_note_sequence[3];
single_note_sequence[0] = note;
- // 48 ticks per second for the tc0?
- // Each tick is approximately 20ms
- uint16_t duration = duration_ms / 20;
+ // 64 ticks per second for the tc0
+ // Each tick is approximately 15ms
+ uint16_t duration = duration_ms / 15;
if (duration > 127) duration = 127;
single_note_sequence[1] = (int8_t)duration;
single_note_sequence[2] = 0;
watch_set_buzzer_on();
} else watch_set_buzzer_off();
// set duration ticks and move to next tone
- _tone_ticks = _sequence[_seq_position + 1];
+ _tone_ticks = _sequence[_seq_position + 1] - 1;
_seq_position += 2;
} else {
// end the sequence
if (_tone_ticks == 0) {
done = _raw_source(_seq_position, _userdata, &period, &duration);
- if (done) {
+ if (done || duration == 0) {
// end the sequence
watch_buzzer_abort_sequence();
} else {
}
// set duration ticks and move to next tone
- _tone_ticks = duration;
+ _tone_ticks = duration - 1;
_seq_position += 1;
}
} else {
static int8_t single_note_sequence[3];
single_note_sequence[0] = note;
- // 48 ticks per second for the tc0?
- // Each tick is approximately 20ms
- uint16_t duration = duration_ms / 20;
+ // 64 ticks per second for the tc0
+ // Each tick is approximately 15ms
+ uint16_t duration = duration_ms / 15;
if (duration > 127) duration = 127;
single_note_sequence[1] = (int8_t)duration;
single_note_sequence[2] = 0;
watch_set_buzzer_on();
}
// set duration ticks and move to next tone
- _tone_ticks = _sequence[_seq_position + 1];
+ _tone_ticks = _sequence[_seq_position + 1] - 1;
_seq_position += 2;
} else {
// end the sequence
if (_tone_ticks == 0) {
done = _raw_source(_seq_position, _userdata, &period, &duration);
- if (done) {
+ if (done || duration == 0) {
// end the sequence
watch_buzzer_abort_sequence();
} else {
}
// set duration ticks and move to next tone
- _tone_ticks = duration;
+ _tone_ticks = duration - 1;
_seq_position += 1;
}
} else {
static int8_t single_note_sequence[3];
single_note_sequence[0] = note;
- // 64 ticks per second for the tc0?
+ // 64 ticks per second for the tc0
// Each tick is approximately 15ms
uint16_t duration = duration_ms / 15;
if (duration > 127) duration = 127;