Skip to content

Commit a37bc96

Browse files
committed
codal_app: Make sure volume can achieve the full CODAL range.
The CODAL setVolume() method takes a value in the range 0-255. Fixes issue #159. Signed-off-by: Damien George <damien@micropython.org>
1 parent 957e810 commit a37bc96

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/codal_app/microbithal_audio.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@ void microbit_hal_audio_select_speaker(bool enable) {
7676

7777
// Input value has range 0-255 inclusive.
7878
void microbit_hal_audio_set_volume(int value) {
79-
if (value >= 255) {
80-
uBit.audio.setVolume(128);
81-
} else {
82-
uBit.audio.setVolume(value / 2);
83-
}
79+
uBit.audio.setVolume(value);
8480
}
8581

8682
void microbit_hal_sound_synth_callback(int event) {

0 commit comments

Comments
 (0)