diff options
| author | hathach <[email protected]> | 2018-12-11 10:50:05 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-12-11 10:50:05 +0700 |
| commit | b0717275c838306688cc9bb2af625725656856d5 (patch) | |
| tree | 4ff6cccefa963edf0b8a7f8a65d3a101e9d5df56 /src/host/usbh.c | |
| parent | 73e6bb6f5d9461915bd157e5802eb6f6436b5831 (diff) | |
ehci periodic
Diffstat (limited to 'src/host/usbh.c')
| -rw-r--r-- | src/host/usbh.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index 8e03d97d1..3ab3bd71e 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -319,15 +319,16 @@ void hcd_event_device_remove(uint8_t hostid) // a device unplugged on hostid, hub_addr, hub_port
// return true if found and unmounted device, false if cannot find
-static void usbh_device_unplugged(uint8_t hostid, uint8_t hub_addr, uint8_t hub_port)
+static void usbh_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t hub_port)
{
bool is_found = false;
+
//------------- find the all devices (star-network) under port that is unplugged -------------//
for (uint8_t dev_addr = 0; dev_addr <= CFG_TUSB_HOST_DEVICE_MAX; dev_addr ++)
{
usbh_device_t* dev = &_usbh_devices[dev_addr];
- if (dev->rhport == hostid &&
+ if (dev->rhport == rhport &&
(hub_addr == 0 || dev->hub_addr == hub_addr) && // hub_addr == 0 & hub_port == 0 means roothub
(hub_port == 0 || dev->hub_port == hub_port) &&
dev->state != TUSB_DEVICE_STATE_UNPLUG)
@@ -349,11 +350,14 @@ static void usbh_device_unplugged(uint8_t hostid, uint8_t hub_addr, uint8_t hub_ usbh_pipe_control_close(dev_addr);
+// hcd_device_remove(rhport, dev_addr);
+
is_found = true;
}
}
- if (is_found) hcd_port_unplug(_usbh_devices[0].rhport); // TODO hack
+ // FIXME remove
+ if (is_found) hcd_device_remove(_usbh_devices[0].rhport, 0);
}
|
