diff options
| author | Ha Thach <[email protected]> | 2024-03-28 22:23:11 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-03-28 22:23:11 +0700 |
| commit | 5ff6e0f99285279267c6039ccbeca0139c045416 (patch) | |
| tree | 6cd622fecc9775ca0435bd6c2488fbc39e780434 /src | |
| parent | a5a90937b4d6c2d67491ed335fd901a77c2ac50f (diff) | |
| parent | ddb1034a9c77d8ef4efccf3df76013f86efe5e09 (diff) | |
Merge pull request #2546 from tannewt/unplug_on_deinit
Fake unplug devices when a root hub is deinit
Diffstat (limited to 'src')
| -rw-r--r-- | src/host/usbh.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index f2dc2f7c1..05091736e 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -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 |
