Update UC3 platform driver support to use the bitmasks defined in the header files...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Common / HIDParser.c
index b90f89e..bd0937b 100644 (file)
@@ -189,7 +189,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
                                        CurrCollectionPath->Parent = ParentCollectionPath;
                                }
 
-                               CurrCollectionPath->Type = ReportItemData;
+                               CurrCollectionPath->Type       = ReportItemData;
                                CurrCollectionPath->Usage.Page = CurrStateTable->Attributes.Usage.Page;
 
                                if (UsageListSize)
@@ -290,6 +290,9 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
 bool USB_GetHIDReportItemInfo(const uint8_t* ReportData,
                               HID_ReportItem_t* const ReportItem)
 {
+       if (ReportItem == NULL)
+               return false;
+
        uint16_t DataBitsRem  = ReportItem->Attributes.BitSize;
        uint16_t CurrentBit   = ReportItem->BitOffset;
        uint32_t BitMask      = (1 << 0);
@@ -320,6 +323,9 @@ bool USB_GetHIDReportItemInfo(const uint8_t* ReportData,
 void USB_SetHIDReportItemInfo(uint8_t* ReportData,
                               HID_ReportItem_t* const ReportItem)
 {
+       if (ReportItem == NULL)
+               return;
+
        uint16_t DataBitsRem  = ReportItem->Attributes.BitSize;
        uint16_t CurrentBit   = ReportItem->BitOffset;
        uint32_t BitMask      = (1 << 0);