summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2021-12-03 00:30:09 +0700
committerGitHub <[email protected]>2021-12-03 00:30:09 +0700
commit6ecd93eb6051b22c5475a66dc992b5aac0fac96e (patch)
tree51f1d6a4a7cc0667308ed32398824729380087b0 /src/host
parent9bccc8068baf6efef0bd040ec5238369c0a03c0f (diff)
parent3e9bb3bee1e835a0d99c3f503c63cf0481b45ce2 (diff)
Merge branch 'master' into add_hcd_for_msp_exp432e401y
Diffstat (limited to 'src/host')
-rw-r--r--src/host/usbh.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index f74e7114c..b8439addc 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -541,10 +541,12 @@ void process_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t hub_port
usbh_class_drivers[drv_id].close(dev_addr);
}
+ 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
-
- hcd_device_close(rhport, dev_addr);
+ tu_memclr(dev->ep_status, sizeof(dev->ep_status));
dev->state = TUSB_DEVICE_STATE_UNPLUG;
}