diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-03-23 09:25:13 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-03-23 09:25:13 +0000 |
commit | fa5c8700bc0f9efb36f779e217c9fd1e81f8efb6 (patch) | |
tree | d4c23f4514fe901c66425ab0f8d2bd16242521f7 /LUFA/Drivers/USB/Class/Common | |
parent | f595043584d864d2618da62f422cf57ed5eda6f4 (diff) | |
download | lufa-fa5c8700bc0f9efb36f779e217c9fd1e81f8efb6.tar.gz lufa-fa5c8700bc0f9efb36f779e217c9fd1e81f8efb6.tar.bz2 lufa-fa5c8700bc0f9efb36f779e217c9fd1e81f8efb6.zip |
Fix corner case in the HID report descriptor Mouse/Joystick tempates at the 8/16 bit boundary.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Common')
-rw-r--r-- | LUFA/Drivers/USB/Class/Common/HID.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/HID.h b/LUFA/Drivers/USB/Class/Common/HID.h index 968b2655e..f02e709d8 100644 --- a/LUFA/Drivers/USB/Class/Common/HID.h +++ b/LUFA/Drivers/USB/Class/Common/HID.h @@ -360,7 +360,7 @@ HID_RI_PHYSICAL_MINIMUM(16, MinPhysicalVal), \ HID_RI_PHYSICAL_MAXIMUM(16, MaxPhysicalVal), \ HID_RI_REPORT_COUNT(8, 0x02), \ - HID_RI_REPORT_SIZE(8, (((((uint16_t)MinAxisVal > 0xFF) && ((uint16_t)MaxAxisVal < 0xFF)) ? 8 : 16))), \ + HID_RI_REPORT_SIZE(8, ((((MinAxisVal >= -0xFF) && (MaxAxisVal <= 0xFF)) ? 8 : 16))), \ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), \ HID_RI_END_COLLECTION(0), \ HID_RI_USAGE_PAGE(8, 0x09), \ @@ -476,7 +476,7 @@ HID_RI_PHYSICAL_MINIMUM(16, MinPhysicalVal), \ HID_RI_PHYSICAL_MAXIMUM(16, MaxPhysicalVal), \ HID_RI_REPORT_COUNT(8, 0x02), \ - HID_RI_REPORT_SIZE(8, (((((uint16_t)MinAxisVal > 0xFF) && ((uint16_t)MaxAxisVal < 0xFF)) ? 8 : 16))), \ + HID_RI_REPORT_SIZE(8, ((((MinAxisVal >= -0xFF) && (MaxAxisVal <= 0xFF)) ? 8 : 16))), \ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | (AbsoluteCoords ? HID_IOF_ABSOLUTE : HID_IOF_RELATIVE)), \ HID_RI_END_COLLECTION(0), \ HID_RI_END_COLLECTION(0) |