Tighten up the code in the delta movement detection code in the MouseHostWithParser and JoystickHostWithParser demos. Make the ClassDriver JoystickHostWithParser demo use the HID_ALIGN_DATA() macro instead of manual shifting and casting.
This commit is contained in:
@@ -159,14 +159,11 @@ int main(void)
|
||||
{
|
||||
int16_t DeltaMovement = HID_ALIGN_DATA(ReportItem, int16_t);
|
||||
|
||||
if (ReportItem->Attributes.Usage.Usage == USAGE_X)
|
||||
if (DeltaMovement)
|
||||
{
|
||||
if (DeltaMovement)
|
||||
if (ReportItem->Attributes.Usage.Usage == USAGE_X)
|
||||
LEDMask |= ((DeltaMovement > 0) ? LEDS_LED1 : LEDS_LED2);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DeltaMovement)
|
||||
else
|
||||
LEDMask |= ((DeltaMovement > 0) ? LEDS_LED3 : LEDS_LED4);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user