mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Unwedge failed device on failed attempt.
This commit is contained in:
parent
5656fa9b6d
commit
226b4b6658
1 changed files with 12 additions and 0 deletions
12
Usb.cpp
12
Usb.cpp
|
@ -581,6 +581,18 @@ uint8_t USB::AttemptConfig(uint8_t driver, uint8_t parent, uint8_t port, bool lo
|
|||
}
|
||||
}
|
||||
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.
|
||||
regWr(rHCTL, bmBUSRST); //issue bus reset
|
||||
delay(102); // delay 102ms, compensate for clock inaccuracy.
|
||||
} else {
|
||||
// reset parent port
|
||||
devConfig[parent]->ResetHubPort(port);
|
||||
}
|
||||
|
||||
}
|
||||
return rcode;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue