Skip to content

Commit 48434cf

Browse files
committed
USBHOST: fix call back
1 parent 1577037 commit 48434cf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

features/unsupported/USBHost/USBHost/USBDeviceConnected.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void USBDeviceConnected::init(uint8_t hub_, uint8_t port_, bool lowSpeed_) {
9494

9595
void USBDeviceConnected::disconnect() {
9696
for(int i = 0; i < MAX_INTF; i++) {
97-
intf[i].detach.call();
97+
if (intf[i].detach) intf[i].detach.call();
9898
}
9999
init();
100100
}

features/unsupported/USBHost/USBHost/USBEndpoint.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ class USBEndpoint
104104
* Call the handler associted to the end of a transfer
105105
*/
106106
inline void call() {
107-
rx.call();
107+
if (rx)
108+
rx.call();
108109
};
109110

110111

0 commit comments

Comments
 (0)