aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB/Class/Common/HIDParser.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-09-17 13:07:21 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-09-17 13:07:21 +0000
commit99ff27e4038b90eeed38c2a15ca8352152364d68 (patch)
treeb60def0182a5166e148590e9552e92d7fe8c4fe7 /LUFA/Drivers/USB/Class/Common/HIDParser.c
parentd881e0cbf691793ab6e5fe24f091549a007e009a (diff)
downloadlufa-99ff27e4038b90eeed38c2a15ca8352152364d68.tar.gz
lufa-99ff27e4038b90eeed38c2a15ca8352152364d68.tar.bz2
lufa-99ff27e4038b90eeed38c2a15ca8352152364d68.zip
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.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Common/HIDParser.c')
-rw-r--r--LUFA/Drivers/USB/Class/Common/HIDParser.c3
1 files changed, 1 insertions, 2 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;