Explorar o código

on unplug release device endpoints

rppicomidi %!s(int64=4) %!d(string=hai) anos
pai
achega
006522e437
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/host/usbh.c

+ 3 - 0
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;
     }
   }