mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-26 16:01:02 +02:00
fix(usb/host): Fix disconnection error handling
In a very rare case of having 2 or more events of type DISCONNECTION/ERROR/OVERCURRENT in a short time, the driver has not yet recovered from the 1st error but already got a 2nd error. Closes https://github.com/espressif/esp-idf/issues/13364 Closes https://github.com/espressif/esp-idf/issues/15290
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@@ -826,6 +826,13 @@ reset_err:
|
|||||||
// There is an enabled (active) device. We need to indicate to USBH that the device is gone
|
// There is an enabled (active) device. We need to indicate to USBH that the device is gone
|
||||||
pass_event_to_usbh = true;
|
pass_event_to_usbh = true;
|
||||||
break;
|
break;
|
||||||
|
case ROOT_PORT_STATE_RECOVERY:
|
||||||
|
// In a very rare case of having 2 or more events of type DISCONNECTION/ERROR/OVERCURRENT
|
||||||
|
// in a short time, we can endup here, where the driver has not yet recovered from
|
||||||
|
// the 1st error but already got a 2nd error.
|
||||||
|
// Just check that the RECOVER action is requested and return
|
||||||
|
assert(p_hub_driver_obj->dynamic.port_reqs | PORT_REQ_RECOVER);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
abort(); // Should never occur
|
abort(); // Should never occur
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user