From 99ff27e4038b90eeed38c2a15ca8352152364d68 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sat, 17 Sep 2011 13:07:21 +0000 Subject: Fixed HID Parser's largest report size bit count not including the size of the last parsed report item. Fixed HID host driver's largest HID report size count corrupt when the number of report bits exceeds 255. --- LUFA/Drivers/USB/Class/Common/HIDParser.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'LUFA/Drivers/USB/Class/Common/HIDParser.c') 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; -- cgit v1.2.3