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:
parent
eb060db71b
commit
f4de17207e
3 changed files with 12 additions and 6 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue