mirror of
https://github.com/hathach/tinyusb.git
synced 2025-05-08 06:35:49 +08:00
Move decouncing delay before USB reset.
Signed-off-by: HiFiPhile <admin@hifiphile.com>
This commit is contained in:
parent
9f096ac56b
commit
3c4e6a779d
@ -1692,6 +1692,15 @@ static bool enum_new_device(hcd_event_t* event) {
|
||||
_dev0.hub_port = event->connection.hub_port;
|
||||
|
||||
if (_dev0.hub_addr == 0) {
|
||||
// wait until device connection is stable TODO non blocking
|
||||
tusb_time_delay_ms_api(ENUM_DEBOUNCING_DELAY_MS);
|
||||
|
||||
// device unplugged while delaying
|
||||
if (!hcd_port_connect_status(_dev0.rhport)) {
|
||||
enum_full_complete();
|
||||
return true;
|
||||
}
|
||||
|
||||
// connected directly to roothub
|
||||
hcd_port_reset(_dev0.rhport);
|
||||
|
||||
@ -1701,9 +1710,6 @@ static bool enum_new_device(hcd_event_t* event) {
|
||||
|
||||
hcd_port_reset_end(_dev0.rhport);
|
||||
|
||||
// wait until device connection is stable TODO non blocking
|
||||
tusb_time_delay_ms_api(ENUM_DEBOUNCING_DELAY_MS);
|
||||
|
||||
// device unplugged while delaying
|
||||
if (!hcd_port_connect_status(_dev0.rhport)) {
|
||||
enum_full_complete();
|
||||
|
Loading…
x
Reference in New Issue
Block a user