diff --git a/core/usbh_core.c b/core/usbh_core.c index 211636de..79c6cf95 100644 --- a/core/usbh_core.c +++ b/core/usbh_core.c @@ -546,15 +546,15 @@ int usbh_enumerate(struct usbh_hubport *hport) struct usbh_class_driver *class_driver = (struct usbh_class_driver *)usbh_find_class_driver(intf_desc->bInterfaceClass, intf_desc->bInterfaceSubClass, intf_desc->bInterfaceProtocol, hport->device_desc.idVendor, hport->device_desc.idProduct); if (class_driver == NULL) { - USB_LOG_ERR("do not support Class:0x%02x,Subclass:0x%02x,Protocl:0x%02x\r\n", + USB_LOG_ERR("Do not support Class:0x%02x, Subclass:0x%02x, Protocl:0x%02x on interface %u\r\n", intf_desc->bInterfaceClass, intf_desc->bInterfaceSubClass, - intf_desc->bInterfaceProtocol); - + intf_desc->bInterfaceProtocol, + i); continue; } hport->config.intf[i].class_driver = class_driver; - USB_LOG_INFO("Loading %s class driver\r\n", class_driver->driver_name); + USB_LOG_INFO("Loading %s class driver on interface %u\r\n", class_driver->driver_name, i); ret = CLASS_CONNECT(hport, i); } @@ -570,6 +570,7 @@ void usbh_hubport_release(struct usbh_hubport *hport) { if (hport->connected) { hport->connected = false; + usbh_kill_urb(&hport->ep0_urb); usbh_free_devaddr(hport); for (uint8_t i = 0; i < hport->config.config_desc.bNumInterfaces; i++) { if (hport->config.intf[i].class_driver && hport->config.intf[i].class_driver->disconnect) { @@ -577,7 +578,6 @@ void usbh_hubport_release(struct usbh_hubport *hport) } } hport->config.config_desc.bNumInterfaces = 0; - usbh_kill_urb(&hport->ep0_urb); if (hport->mutex) { usb_osal_mutex_delete(hport->mutex); }