Skip to content

Commit 0d1aa59

Browse files
wmarkowbaldram
authored andcommitted
Set the volume always (#28)
Remove the cache which causes an issue in some use scenarios
1 parent aeddbd3 commit 0d1aa59

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/VS1053.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,10 @@ void VS1053::setVolume(uint8_t vol) {
191191
// Input value is 0..100. 100 is the loudest.
192192
uint16_t value; // Value to send to SCI_VOL
193193

194-
if (vol != curvol) {
195-
curvol = vol; // Save for later use
196-
value = map(vol, 0, 100, 0xFF, 0x00); // 0..100% to one channel
197-
value = (value << 8) | value;
198-
write_register(SCI_VOL, value); // Volume left and right
199-
}
194+
curvol = vol; // Save for later use
195+
value = map(vol, 0, 100, 0xFF, 0x00); // 0..100% to one channel
196+
value = (value << 8) | value;
197+
write_register(SCI_VOL, value); // Volume left and right
200198
}
201199

202200
void VS1053::setTone(uint8_t *rtone) { // Set bass/treble (4 nibbles)

0 commit comments

Comments
 (0)