USBH: HID: corrected interrupt IN request length

This commit is contained in:
Diego Ismirlian 2017-07-14 11:01:44 -03:00
parent 2e2e10417e
commit 0f269d99fd
1 changed files with 4 additions and 1 deletions

View File

@ -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);