Unwedge failed device on failed attempt.

This commit is contained in:
Andrew J. Kroll 2013-09-29 18:22:37 -04:00
parent 5656fa9b6d
commit 226b4b6658

12
Usb.cpp
View file

@ -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;
}