Minor documentation corrections.
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Common / HIDParser.c
index b601d86..24b284c 100644 (file)
@@ -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);
                        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):
                                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;
 
 
                                        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;
 
                                        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;
 }
 
        return 0;
 }
+