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
5
Usb.cpp
5
Usb.cpp
|
@ -581,6 +581,11 @@ uint8_t USB::AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rcode = devConfig[driver]->Init(parent, port, lowspeed);
|
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);
|
||||||
|
devConfig[driver]->ConfigureDevice(parent, port, lowspeed); // Just ignore the returned value
|
||||||
|
rcode = devConfig[driver]->Init(parent, port, lowspeed);
|
||||||
|
}
|
||||||
if (rcode) {
|
if (rcode) {
|
||||||
// Issue a bus reset, because the device may be in a limbo state
|
// Issue a bus reset, because the device may be in a limbo state
|
||||||
if (parent == 0) {
|
if (parent == 0) {
|
||||||
|
|
Loading…
Reference in a new issue