summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-11-30 17:36:52 +0700
committerhathach <[email protected]>2021-11-30 17:36:52 +0700
commit3e3fe1e429aed7bd0000f49b1ef15f83eb815a19 (patch)
tree363a1f6b1aeb526c53dfeab07a7fa08ba8fcec4b /src/host
parent006522e4375d58bfe01b9745ff7df35fb3d48868 (diff)
improve hcd_device_close() for rp2040
Diffstat (limited to 'src/host')
-rw-r--r--src/host/usbh.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index eca72a1c5..b8439addc 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -541,12 +541,11 @@ void process_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t hub_port
usbh_class_drivers[drv_id].close(dev_addr);
}
- memset(dev->itf2drv, DRVID_INVALID, sizeof(dev->itf2drv)); // invalid mapping
- memset(dev->ep2drv , DRVID_INVALID, sizeof(dev->ep2drv )); // invalid mapping
-
hcd_device_close(rhport, dev_addr);
// release all endpoints associated with the device
+ memset(dev->itf2drv, DRVID_INVALID, sizeof(dev->itf2drv)); // invalid mapping
+ memset(dev->ep2drv , DRVID_INVALID, sizeof(dev->ep2drv )); // invalid mapping
tu_memclr(dev->ep_status, sizeof(dev->ep_status));
dev->state = TUSB_DEVICE_STATE_UNPLUG;