mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Don't call init if an error is returned
This commit is contained in:
parent
332f56f46d
commit
7990c32ad6
1 changed files with 16 additions and 15 deletions
3
Usb.cpp
3
Usb.cpp
|
@ -580,6 +580,7 @@ uint8_t USB::AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lo
|
|||
devConfig[parent]->ResetHubPort(port);
|
||||
}
|
||||
}
|
||||
if (!rcode || rcode == USB_ERROR_CONFIG_REQUIRES_ADDITIONAL_RESET) {
|
||||
rcode = devConfig[driver]->Init(parent, port, lowspeed);
|
||||
if (rcode == hrJERR) { // Some devices returns this when plugged in - trying to initialize the device again usually works
|
||||
delay(100);
|
||||
|
@ -596,7 +597,7 @@ uint8_t USB::AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lo
|
|||
// reset parent port
|
||||
devConfig[parent]->ResetHubPort(port);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return rcode;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue