From 0f269d99fd170929f613b9fa9edcc9af1a5b7c2b Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Fri, 14 Jul 2017 11:01:44 -0300 Subject: [PATCH] USBH: HID: corrected interrupt IN request length --- os/hal/src/usbh/hal_usbh_hid.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/os/hal/src/usbh/hal_usbh_hid.c b/os/hal/src/usbh/hal_usbh_hid.c index 269b1b29..6d0e116f 100644 --- a/os/hal/src/usbh/hal_usbh_hid.c +++ b/os/hal/src/usbh/hal_usbh_hid.c @@ -222,8 +222,11 @@ void usbhhidStart(USBHHIDDriver *hidp, const USBHHIDConfig *cfg) { hidp->config = cfg; /* init the URBs */ + uint32_t report_len = hidp->epin.wMaxPacketSize; + if (report_len > cfg->report_len) + report_len = cfg->report_len; usbhURBObjectInit(&hidp->in_urb, &hidp->epin, _in_cb, hidp, - cfg->report_buffer, cfg->report_len); + cfg->report_buffer, report_len); /* open the int IN/OUT endpoints */ usbhEPOpen(&hidp->epin);