Skip to content

Commit e27b7e6

Browse files
jamike0xc0170
authored andcommitted
USBHOST: fix call back
1 parent 13feab6 commit e27b7e6

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
@@ -105,7 +105,8 @@ class USBEndpoint
105105
* Call the handler associted to the end of a transfer
106106
*/
107107
inline void call() {
108-
rx.call();
108+
if (rx)
109+
rx.call();
109110
};
110111

111112

0 commit comments

Comments
 (0)