Merge pull request #2546 from tannewt/unplug_on_deinit

Fake unplug devices when a root hub is deinit
This commit is contained in:
Ha Thach 2024-03-28 22:23:11 +07:00 committed by GitHub
commit 5ff6e0f992
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -412,9 +412,11 @@ bool tuh_deinit(uint8_t rhport) {
// deinit host controller
hcd_int_disable(rhport);
hcd_deinit(rhport);
_usbh_controller = TUSB_INDEX_INVALID_8;
// "unplug" all devices on this rhport (hub_addr = 0, hub_port = 0)
process_removing_device(rhport, 0, 0);
// deinit host stack if no controller is active
if (!tuh_inited()) {
// Class drivers