Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/pbio/drv/sound/sound_ev3.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ void pbdrv_sound_stop() {
}

void pbdrv_beep_start(uint32_t frequency, uint16_t sample_attenuator) {
// A frequency of 0 is equivalent to turning the sound off
if (frequency == 0) {
pbdrv_sound_stop();
return;
}

// Clamp the frequency into the supported range
if (frequency < 64) {
frequency = 64;
Expand Down