add buzzer volume control
This commit is contained in:
@@ -334,7 +334,7 @@ static void _activity_chirp_tick_transmit(void *context) {
|
||||
return;
|
||||
}
|
||||
uint16_t period = chirpy_get_tone_period(tone);
|
||||
watch_set_buzzer_period(period);
|
||||
watch_set_buzzer_period_and_duty_cycle(period, 25);
|
||||
watch_set_buzzer_on();
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ static void _activity_chirp_tick_countdown(void *context) {
|
||||
}
|
||||
// Sound or turn off buzzer
|
||||
if ((state->chirpy_tick_state.seq_pos % 8) == 0) {
|
||||
watch_set_buzzer_period(NotePeriods[BUZZER_NOTE_A5]);
|
||||
watch_set_buzzer_period_and_duty_cycle(NotePeriods[BUZZER_NOTE_A5], 25);
|
||||
watch_set_buzzer_on();
|
||||
if (state->chirpy_tick_state.seq_pos == 0) {
|
||||
watch_display_string(" --- ", 4);
|
||||
|
||||
@@ -84,7 +84,7 @@ static void update_buzzer(const tuning_tones_state_t *state)
|
||||
{
|
||||
if (state->playing) {
|
||||
watch_set_buzzer_off();
|
||||
watch_set_buzzer_period(NotePeriods[notes[state->note_ind].note]);
|
||||
watch_set_buzzer_period_and_duty_cycle(NotePeriods[notes[state->note_ind].note], 25);
|
||||
watch_set_buzzer_on();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ static void _cdf_scale_tick(void *context) {
|
||||
}
|
||||
uint32_t freq = 700 + tick_state->seq_pos * 200;
|
||||
uint32_t period = 1000000 / freq;
|
||||
watch_set_buzzer_period(period);
|
||||
watch_set_buzzer_period_and_duty_cycle(period, 25);
|
||||
watch_set_buzzer_on();
|
||||
++tick_state->seq_pos;
|
||||
}
|
||||
@@ -183,7 +183,7 @@ static void _cdf_data_tick(void *context) {
|
||||
return;
|
||||
}
|
||||
uint16_t period = chirpy_get_tone_period(tone);
|
||||
watch_set_buzzer_period(period);
|
||||
watch_set_buzzer_period_and_duty_cycle(period, 25);
|
||||
watch_set_buzzer_on();
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ static void _cdf_countdown_tick(void *context) {
|
||||
}
|
||||
// Sound or turn off buzzer
|
||||
if ((tick_state->seq_pos % 8) == 0) {
|
||||
watch_set_buzzer_period(NotePeriods[BUZZER_NOTE_A5]);
|
||||
watch_set_buzzer_period_and_duty_cycle(NotePeriods[BUZZER_NOTE_A5], 25);
|
||||
watch_set_buzzer_on();
|
||||
} else if ((tick_state->seq_pos % 8) == 1) {
|
||||
watch_set_buzzer_off();
|
||||
|
||||
Reference in New Issue
Block a user