From 66db760a3338667bfdd02eb24e0e7f1319ca3ec1 Mon Sep 17 00:00:00 2001 From: e-chip Date: Wed, 28 Sep 2016 14:12:33 +0600 Subject: Fix USB_SetHIDReportItemInfo() function. Bits applying loop worked incorrect on large reports. Seems to me like a copy/paste problem from USB_GetHIDReportItemInfo(). --- LUFA/Drivers/USB/Class/Common/HIDParser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'LUFA/Drivers') diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.c b/LUFA/Drivers/USB/Class/Common/HIDParser.c index c01ceaf78..00100a64a 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Common/HIDParser.c @@ -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; -- cgit v1.2.3