From 006522e4375d58bfe01b9745ff7df35fb3d48868 Mon Sep 17 00:00:00 2001 From: rppicomidi Date: Fri, 12 Nov 2021 14:59:19 -0800 Subject: [PATCH] on unplug release device endpoints --- src/host/usbh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/host/usbh.c b/src/host/usbh.c index f74e7114..eca72a1c 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -546,6 +546,9 @@ void process_device_unplugged(uint8_t rhport, uint8_t hub_addr, uint8_t hub_port hcd_device_close(rhport, dev_addr); + // release all endpoints associated with the device + tu_memclr(dev->ep_status, sizeof(dev->ep_status)); + dev->state = TUSB_DEVICE_STATE_UNPLUG; } }