From a7e8a2ba9aa5e8a6ba074f397b1fd789a8f25205 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 26 Mar 2013 02:06:30 +0700 Subject: pass all the current tests --- tinyusb/host/usbh.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tinyusb/host') diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index 587e8a840..7559142c2 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -232,8 +232,11 @@ void usbh_device_unplugged_isr(uint8_t hostid) // if device unplugged is not a hub TODO handle hub unplugged for (uint8_t class_code = 1; class_code < TUSB_CLASS_MAX_CONSEC_NUMBER; class_code++) { - if (usbh_class_drivers[class_code].close) + if ((usbh_devices[dev_addr].flag_supported_class & BIT_(class_code)) && + usbh_class_drivers[class_code].close) + { usbh_class_drivers[class_code].close(dev_addr); + } } } -- cgit v1.3.1