Skip to content

Commit ad09abb

Browse files
committed
USBAudio , USBSerial :fix call back
1 parent 06ebe4f commit ad09abb

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

features/unsupported/USBDevice/USBAudio/USBAudio.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ void USBAudio::USBCallback_requestCompleted(uint8_t * buf, uint32_t length) {
313313
switch (transfer->setup.bRequest) {
314314
case REQUEST_SET_CUR:
315315
mute = data & 0xff;
316-
updateVol.call();
316+
if (updateVol)
317+
updateVol.call();
317318
break;
318319
default:
319320
break;
@@ -324,7 +325,8 @@ void USBAudio::USBCallback_requestCompleted(uint8_t * buf, uint32_t length) {
324325
case REQUEST_SET_CUR:
325326
volCur = data;
326327
volume = (float)volCur/(float)volMax;
327-
updateVol.call();
328+
if (updateVol)
329+
updateVol.call();
328330
break;
329331
default:
330332
break;

features/unsupported/USBDevice/USBSerial/USBSerial.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ bool USBSerial::EPBULK_OUT_callback() {
5656
buf.queue(c[i]);
5757
}
5858

59-
//call a potential handler
60-
rx.call();
59+
//call a potential handlenr
60+
if (rx)
61+
rx.call();
6162

6263
return true;
6364
}

0 commit comments

Comments
 (0)