diff options
| author | hathach <[email protected]> | 2024-03-28 21:45:52 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-03-28 21:45:52 +0700 |
| commit | ddb1034a9c77d8ef4efccf3df76013f86efe5e09 (patch) | |
| tree | 6cd622fecc9775ca0435bd6c2488fbc39e780434 /src | |
| parent | d50003e33d89740c0993ae236629392df82453c2 (diff) | |
use hub_addr=0, hub_port=0 for removing root hub port
Diffstat (limited to 'src')
| -rw-r--r-- | src/host/usbh.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index 29c6eb1e9..05091736e 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -412,17 +412,10 @@ 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 - for (uint8_t idx = 0; idx < CFG_TUH_DEVICE_MAX + CFG_TUH_HUB; idx++) { - usbh_device_t *dev = &_usbh_devices[idx]; - if (!dev->connected || dev->rhport != rhport) { - continue; - } - process_removing_device(rhport, dev->hub_addr, dev->hub_port); - } + // "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()) { |
