1
0
mirror of https://github.com/hathach/tinyusb.git synced 2025-03-25 23:38:06 +00:00

fix potential bug with mis-align issue

This commit is contained in:
hathach 2019-09-01 17:20:10 +07:00
parent 074681da8b
commit 80cde5b0b5

@ -178,7 +178,7 @@ bool hidd_open(uint8_t rhport, tusb_desc_interface_t const * desc_itf, uint16_t
p_hid->boot_mode = false; // default mode is REPORT
p_hid->itf_num = desc_itf->bInterfaceNumber;
p_hid->reprot_desc_len = desc_hid->wReportLength;
memcpy(&p_hid->reprot_desc_len, &desc_hid->wReportLength, 2);
*p_len = sizeof(tusb_desc_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + desc_itf->bNumEndpoints*sizeof(tusb_desc_endpoint_t);