Merge pull request #89 from e-chip/master
authorDean Camera <dean@fourwalledcubicle.com>
Wed, 28 Sep 2016 08:39:55 +0000 (18:39 +1000)
committerGitHub <noreply@github.com>
Wed, 28 Sep 2016 08:39:55 +0000 (18:39 +1000)
Fix incorrect serialization in USB_SetHIDReportItemInfo() function (thanks to e-chip).

LUFA/Drivers/USB/Class/Common/HIDParser.c

index c01ceaf..00100a6 100644 (file)
@@ -364,8 +364,8 @@ void USB_SetHIDReportItemInfo(uint8_t* ReportData,
 
        while (DataBitsRem--)
        {
-               if (ReportItem->Value & (1 << (CurrentBit % 8)))
-                 ReportData[CurrentBit / 8] |= BitMask;
+               if (ReportItem->Value & BitMask)
+                 ReportData[CurrentBit / 8] |= (1 << (CurrentBit % 8));
 
                CurrentBit++;
                BitMask <<= 1;