mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-29 19:20:22 +00:00
Hub: Unplug downstream devices on non-root hub disconnect
This commit is contained in:
parent
9e30ec4f16
commit
b7c8cb3c41
@ -1107,6 +1107,12 @@ static void process_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t h
|
||||
{
|
||||
TU_LOG2(" Address = %u\r\n", dev_addr);
|
||||
|
||||
// If the device itself is a usb hub, unplug downstream devices.
|
||||
if (dev_addr > CFG_TUH_DEVICE_MAX)
|
||||
{
|
||||
process_device_unplugged(rhport, dev_addr, 0);
|
||||
}
|
||||
|
||||
// Invoke callback before close driver
|
||||
if (tuh_umount_cb) tuh_umount_cb(dev_addr);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user