diff options
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r-- | LUFA/Drivers/USB/Class/Common/HIDParser.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/HID.c | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.c b/LUFA/Drivers/USB/Class/Common/HIDParser.c index b601d8638..903b039df 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Common/HIDParser.c @@ -255,8 +255,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType] += CurrStateTable->Attributes.BitSize; - if (ParserData->LargestReportSizeBits < NewReportItem.BitOffset) - ParserData->LargestReportSizeBits = NewReportItem.BitOffset; + ParserData->LargestReportSizeBits = MAX(ParserData->LargestReportSizeBits, CurrReportIDInfo->ReportSizeBits[NewReportItem.ItemType]); if (ParserData->TotalReportItems == HID_MAX_REPORTITEMS) return HID_PARSE_InsufficientReportItems; diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c index fdcd6ee2b..bfbe6cf69 100644 --- a/LUFA/Drivers/USB/Class/Host/HID.c +++ b/LUFA/Drivers/USB/Class/Host/HID.c @@ -421,7 +421,7 @@ uint8_t HID_Host_SetReportProtocol(USB_ClassInfo_HID_Host_t* const HIDInterfaceI return HID_ERROR_LOGICAL | ErrorCode; } - uint8_t LargestReportSizeBits = HIDInterfaceInfo->Config.HIDParserData->LargestReportSizeBits; + uint16_t LargestReportSizeBits = HIDInterfaceInfo->Config.HIDParserData->LargestReportSizeBits; HIDInterfaceInfo->State.LargestReportSize = (LargestReportSizeBits >> 3) + ((LargestReportSizeBits & 0x07) != 0); return 0; |