mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Retry if device returns hrJERR
This commit is contained in:
parent
7abee0b545
commit
47ff8e55c5
1 changed files with 6 additions and 1 deletions
7
Usb.cpp
7
Usb.cpp
|
@ -581,7 +581,12 @@ uint8_t USB::AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lo
|
|||
}
|
||||
}
|
||||
rcode = devConfig[driver]->Init(parent, port, lowspeed);
|
||||
if(rcode) {
|
||||
if (rcode == hrJERR) { // Some devices returns this when plugged in - trying to initialize the device again usually works
|
||||
delay(100);
|
||||
devConfig[driver]->ConfigureDevice(parent, port, lowspeed); // Just ignore the returned value
|
||||
rcode = devConfig[driver]->Init(parent, port, lowspeed);
|
||||
}
|
||||
if (rcode) {
|
||||
// Issue a bus reset, because the device may be in a limbo state
|
||||
if (parent == 0) {
|
||||
// Send a bus reset on the root interface.
|
||||
|
|
Loading…
Reference in a new issue