X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/4b229cb5efbf80295432a52973b5708f54cba748..df33278d9132007c217365bdbd5af1b20038455b:/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..24b284c1d 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Common/HIDParser.c @@ -98,7 +98,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, case HID_RI_USAGE_PAGE(0): if ((HIDReportItem & HID_RI_DATA_SIZE_MASK) == HID_RI_DATA_BITS_32) CurrStateTable->Attributes.Usage.Page = (ReportItemData >> 16); - + CurrStateTable->Attributes.Usage.Page = ReportItemData; break; case HID_RI_LOGICAL_MINIMUM(0): @@ -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; @@ -360,3 +359,4 @@ uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData, return 0; } +