From c044306ad058689783b1a6941a2a44d5baf738a2 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Thu, 13 Jul 2017 16:45:31 -0300 Subject: USBH: Add flexibility to the enumeration process --- testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testhal/STM32/STM32F4xx/USB_HOST') diff --git a/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c b/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c index 9c56866..4585a5c 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c +++ b/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c @@ -72,7 +72,7 @@ static const usbh_classdriver_vmt_t class_driver_vmt = { }; const usbh_classdriverinfo_t usbhCustomClassDriverInfo = { - 0x54, -1, -1, "CUSTOM", &class_driver_vmt + "CUSTOM", &class_driver_vmt }; static usbh_baseclassdriver_t *_load(usbh_device_t *dev, const uint8_t *descriptor, uint16_t rem) { @@ -80,7 +80,7 @@ static usbh_baseclassdriver_t *_load(usbh_device_t *dev, const uint8_t *descript USBHCustomDriver *custp; (void)dev; - if ((rem < descriptor[0]) || (descriptor[1] != USBH_DT_INTERFACE)) + if (_usbh_match_vid_pid(dev, 0xABCD, 0x0123) != HAL_SUCCESS) return NULL; const usbh_interface_descriptor_t * const ifdesc = (const usbh_interface_descriptor_t *)descriptor; -- cgit v1.2.3