}
inline void watch_set_buzzer_period(uint32_t period) {
hri_tcc_write_PERBUF_reg(TCC0, period);
+ hri_tcc_write_CCBUF_reg(TCC0, WATCH_BUZZER_TCC_CHANNEL, period / 2);
}
void watch_disable_buzzer(void) {
if (note == BUZZER_NOTE_REST) {
watch_set_buzzer_off();
} else {
- hri_tcc_write_PERBUF_reg(TCC0, NotePeriods[note]);
- hri_tcc_write_CCBUF_reg(TCC0, WATCH_BUZZER_TCC_CHANNEL, NotePeriods[note] / 2);
+ watch_set_buzzer_period(NotePeriods[note]);
watch_set_buzzer_on();
}
delay_ms(duration_ms);