Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist within the supplied report of a multiple report HID device.
This commit is contained in:
@@ -276,7 +276,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
|
||||
{
|
||||
UsageMinMax.Minimum = 0;
|
||||
UsageMinMax.Maximum = 0;
|
||||
UsageListSize = 0;
|
||||
UsageListSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,9 +292,6 @@ bool USB_GetHIDReportItemInfo(const uint8_t* ReportData,
|
||||
uint16_t DataBitsRem = ReportItem->Attributes.BitSize;
|
||||
uint16_t CurrentBit = ReportItem->BitOffset;
|
||||
uint32_t BitMask = (1 << 0);
|
||||
|
||||
ReportItem->PreviousValue = ReportItem->Value;
|
||||
ReportItem->Value = 0;
|
||||
|
||||
if (ReportItem->ReportID)
|
||||
{
|
||||
@@ -304,6 +301,9 @@ bool USB_GetHIDReportItemInfo(const uint8_t* ReportData,
|
||||
ReportData++;
|
||||
}
|
||||
|
||||
ReportItem->PreviousValue = ReportItem->Value;
|
||||
ReportItem->Value = 0;
|
||||
|
||||
while (DataBitsRem--)
|
||||
{
|
||||
if (ReportData[CurrentBit / 8] & (1 << (CurrentBit % 8)))
|
||||
|
||||
Reference in New Issue
Block a user