Fixed HID Parser not distributing the Usage Min and Usage Max values across an array of report items.
Added new HID_ALIGN_DATA() macro to return the pre-retrieved value of a HID report item, left-aligned to a given datatype. Added new PreviousValue to the HID Report Parser report item structure, for easy monitoring of previous report item values.
This commit is contained in:
parent
f338ddcb87
commit
2919aeeaab
12 changed files with 52 additions and 17 deletions
|
@ -280,7 +280,7 @@ void ProcessMouseReport(uint8_t* MouseReport)
|
|||
if (!(USB_GetHIDReportItemInfo(MouseReport, ReportItem)))
|
||||
continue;
|
||||
|
||||
int16_t WheelDelta = (int16_t)(ReportItem->Value << (16 - ReportItem->Attributes.BitSize));
|
||||
int16_t WheelDelta = HID_ALIGN_DATA(ReportItem, int16_t);
|
||||
|
||||
if (WheelDelta)
|
||||
LEDMask = (LEDS_LED1 | LEDS_LED2 | ((WheelDelta > 0) ? LEDS_LED3 : LEDS_LED4));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue