diff --git a/features/unsupported/USBDevice/USBAudio/USBAudio.cpp b/features/unsupported/USBDevice/USBAudio/USBAudio.cpp index aab9e774e3..a0527aaa5d 100644 --- a/features/unsupported/USBDevice/USBAudio/USBAudio.cpp +++ b/features/unsupported/USBDevice/USBAudio/USBAudio.cpp @@ -313,7 +313,8 @@ void USBAudio::USBCallback_requestCompleted(uint8_t * buf, uint32_t length) { switch (transfer->setup.bRequest) { case REQUEST_SET_CUR: mute = data & 0xff; - updateVol.call(); + if (updateVol) + updateVol.call(); break; default: break; @@ -324,7 +325,8 @@ void USBAudio::USBCallback_requestCompleted(uint8_t * buf, uint32_t length) { case REQUEST_SET_CUR: volCur = data; volume = (float)volCur/(float)volMax; - updateVol.call(); + if (updateVol) + updateVol.call(); break; default: break; diff --git a/features/unsupported/USBDevice/USBSerial/USBSerial.cpp b/features/unsupported/USBDevice/USBSerial/USBSerial.cpp index 4dc28b9e3c..03e039e63f 100644 --- a/features/unsupported/USBDevice/USBSerial/USBSerial.cpp +++ b/features/unsupported/USBDevice/USBSerial/USBSerial.cpp @@ -56,8 +56,9 @@ bool USBSerial::EPBULK_OUT_callback() { buf.queue(c[i]); } - //call a potential handler - rx.call(); + //call a potential handlenr + if (rx) + rx.call(); return true; }