mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Check error code before breaking
This commit is contained in:
parent
3b429e633b
commit
42a2261fe8
1 changed files with 3 additions and 5 deletions
6
Usb.cpp
6
Usb.cpp
|
@ -692,12 +692,10 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) {
|
||||||
for (devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) {
|
for (devConfigIndex = 0; devConfigIndex < USB_NUMDEVICES; devConfigIndex++) {
|
||||||
if (!devConfig[devConfigIndex]) continue; // no driver
|
if (!devConfig[devConfigIndex]) continue; // no driver
|
||||||
if (devConfig[devConfigIndex]->GetAddress()) continue; // consumed
|
if (devConfig[devConfigIndex]->GetAddress()) continue; // consumed
|
||||||
if (devConfig[devConfigIndex]->VIDPIDOK(vid, pid)) {
|
if (devConfig[devConfigIndex]->VIDPIDOK(vid, pid) || devConfig[devConfigIndex]->DEVCLASSOK(klass)) {
|
||||||
rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);
|
rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);
|
||||||
|
if (rcode != USB_DEV_CONFIG_ERROR_DEVICE_NOT_SUPPORTED)
|
||||||
break;
|
break;
|
||||||
} else if (devConfig[devConfigIndex]->DEVCLASSOK(klass)) {
|
|
||||||
rcode = AttemptConfig(devConfigIndex, parent, port, lowspeed);
|
|
||||||
if (!rcode) break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue