Skip to content

Commit fb769b1

Browse files
committed
USBHost: Don't pass NULL in for uint32_t parameters.
USBHostHub.cpp made a few calls to the USBHALHost::deviceDisconnected() virtual method passing in NULL for the addr parameter which is actually declared as uint32_t and not a pointer type. Switching these calls to pass in a 0 for this parameter silences GCC warnings about incompatible types.
1 parent 8281836 commit fb769b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/USBHost/USBHostHub/USBHostHub.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void USBHostHub::rxHandler() {
192192
host->deviceConnected(dev->getHub() + 1, port, status & PORT_LOW_SPEED, this);
193193
} else {
194194
USB_DBG("[hub handler hub: %d - port: %d] device disconnected", dev->getHub(), port);
195-
host->deviceDisconnected(dev->getHub() + 1, port, this, NULL);
195+
host->deviceDisconnected(dev->getHub() + 1, port, this, 0);
196196
}
197197

198198
clearPortFeature(C_PORT_CONNECTION_FEATURE, port);
@@ -209,7 +209,7 @@ void USBHostHub::rxHandler() {
209209
if ((status & PORT_OVER_CURRENT)) {
210210
USB_ERR("OVER CURRENT DETECTED\r\n");
211211
clearPortFeature(PORT_OVER_CURRENT, port);
212-
host->deviceDisconnected(dev->getHub() + 1, port, this, NULL);
212+
host->deviceDisconnected(dev->getHub() + 1, port, this, 0);
213213
}
214214
}
215215
}
@@ -229,7 +229,7 @@ void USBHostHub::portReset(uint8_t port) {
229229
if (status & PORT_OVER_CURRENT) {
230230
USB_ERR("OVER CURRENT DETECTED\r\n");
231231
clearPortFeature(PORT_OVER_CURRENT, port);
232-
host->deviceDisconnected(dev->getHub() + 1, port, this, NULL);
232+
host->deviceDisconnected(dev->getHub() + 1, port, this, 0);
233233
break;
234234
}
235235
Thread::wait(10);

0 commit comments

Comments
 (0)