aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/usbh/hal_usbh_hid.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/src/usbh/hal_usbh_hid.c')
-rw-r--r--os/hal/src/usbh/hal_usbh_hid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/os/hal/src/usbh/hal_usbh_hid.c b/os/hal/src/usbh/hal_usbh_hid.c
index 269b1b2..6d0e116 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);