mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-23 22:43:49 +00:00
use hub_addr=0, hub_port=0 for removing root hub port
This commit is contained in:
parent
d50003e33d
commit
ddb1034a9c
@ -412,17 +412,10 @@ bool tuh_deinit(uint8_t rhport) {
|
|||||||
// deinit host controller
|
// deinit host controller
|
||||||
hcd_int_disable(rhport);
|
hcd_int_disable(rhport);
|
||||||
hcd_deinit(rhport);
|
hcd_deinit(rhport);
|
||||||
|
|
||||||
_usbh_controller = TUSB_INDEX_INVALID_8;
|
_usbh_controller = TUSB_INDEX_INVALID_8;
|
||||||
|
|
||||||
// "unplug" all devices on this rhport
|
// "unplug" all devices on this rhport (hub_addr = 0, hub_port = 0)
|
||||||
for (uint8_t idx = 0; idx < CFG_TUH_DEVICE_MAX + CFG_TUH_HUB; idx++) {
|
process_removing_device(rhport, 0, 0);
|
||||||
usbh_device_t *dev = &_usbh_devices[idx];
|
|
||||||
if (!dev->connected || dev->rhport != rhport) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
process_removing_device(rhport, dev->hub_addr, dev->hub_port);
|
|
||||||
}
|
|
||||||
|
|
||||||
// deinit host stack if no controller is active
|
// deinit host stack if no controller is active
|
||||||
if (!tuh_inited()) {
|
if (!tuh_inited()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user