diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h index c5a1630..6e33565 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Inc/usbh_hid.h @@ -65,6 +65,7 @@ #define HID_MIN_POLL 10 #define HID_MAX_REPORT_SIZE 8 +#define HID_REPORT_BUFFER_SIZE 64 #define HID_MAX_USAGE 10 #define HID_MAX_NBR_REPORT_FMT 10 //#define HID_QUEUE_SIZE 10 @@ -234,7 +235,7 @@ typedef struct _HID_Process uint8_t Protocol; HID_DescTypeDef HID_Desc; TransactionCompleteCallbackTypeDef ReportCallback; - uint8_t Data[HID_MAX_REPORT_SIZE]; + uint8_t Data[HID_REPORT_BUFFER_SIZE]; } HID_HandleTypeDef; diff --git a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid.c b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid.c index 9062efd..10bf289 100644 --- a/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid.c +++ b/Downstream/Middlewares/ST/STM32_USB_Host_Library/Class/HID/Src/usbh_hid.c @@ -173,15 +173,8 @@ static USBH_StatusTypeDef USBH_HID_InterfaceInit (USBH_HandleTypeDef *phost) HID_Handle->poll = phost->device.CfgDesc.Itf_Desc[phost->device.current_interface].Ep_Desc[0].bInterval; HID_Handle->Protocol = phost->device.CfgDesc.Itf_Desc[phost->device.current_interface].bInterfaceProtocol; - if (HID_Handle->poll < HID_MIN_POLL) - { - HID_Handle->poll = HID_MIN_POLL; - } - - if (HID_Handle->length > HID_MAX_REPORT_SIZE) - { - return USBH_FAIL; - } + if (HID_Handle->poll < HID_MIN_POLL) HID_Handle->poll = HID_MIN_POLL; + if (HID_Handle->length > HID_REPORT_BUFFER_SIZE) return USBH_FAIL; //Some mechanical keyboards need to send > 8 byte packets /* Check fo available number of endpoints */ /* Find the number of EPs in the Interface Descriptor */