diff options
author | Diego Ismirlian <dismirlian (at) google's mail.com> | 2017-07-14 11:01:44 -0300 |
---|---|---|
committer | Diego Ismirlian <dismirlian (at) google's mail.com> | 2017-07-14 11:01:44 -0300 |
commit | 0f269d99fd170929f613b9fa9edcc9af1a5b7c2b (patch) | |
tree | 6a122ab9841446594ace55728a1d3c31b3a592c8 /os | |
parent | 2e2e10417e4e2a6e2aec3493fd65859ad80e8c30 (diff) | |
download | ChibiOS-Contrib-0f269d99fd170929f613b9fa9edcc9af1a5b7c2b.tar.gz ChibiOS-Contrib-0f269d99fd170929f613b9fa9edcc9af1a5b7c2b.tar.bz2 ChibiOS-Contrib-0f269d99fd170929f613b9fa9edcc9af1a5b7c2b.zip |
USBH: HID: corrected interrupt IN request length
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/src/usbh/hal_usbh_hid.c | 5 |
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); |