Fix HID descriptor mouse and joystick macros for integer multiples of 8 buttons.
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 23 May 2013 17:54:42 +0000 (19:54 +0200)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 23 May 2013 17:54:42 +0000 (19:54 +0200)
LUFA/DoxygenPages/ChangeLog.txt
LUFA/Drivers/USB/Class/Common/HIDClassCommon.h

index aec199c..8813bcd 100644 (file)
@@ -35,6 +35,8 @@
   *     unknown SCSI command
   *   - Fixed incorrect HID report descriptor generated for 16-bit axis ranges by the HID_DESCRIPTOR_MOUSE() and HID_DESCRIPTOR_JOYSTICK()
   *     macros (thanks to Armory)
+  *   - Fixed incorrect HID report descriptor generated for button multiples of 8 by the HID_DESCRIPTOR_MOUSE() and HID_DESCRIPTOR_JOYSTICK()
+  *     macros
   *   - Fixed race condition in the DFU class bootloader causing failed device reprogramming in some circumstances (thanks to Luis Mendes)
   *
   *  \section Sec_ChangeLog130303 Version 130303
index 3c30daa..f40afd3 100644 (file)
                                HID_RI_REPORT_SIZE(8, 0x01),                \
                                HID_RI_REPORT_COUNT(8, Buttons),            \
                                HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), \
-                               HID_RI_REPORT_SIZE(8, (8 - (Buttons % 8))), \
+                               HID_RI_REPORT_SIZE(8, (Buttons % 8) ? (8 - (Buttons % 8)) : 0), \
                                HID_RI_REPORT_COUNT(8, 0x01),               \
                                HID_RI_INPUT(8, HID_IOF_CONSTANT),          \
                        HID_RI_END_COLLECTION(0)
                                        HID_RI_REPORT_SIZE(8, 0x01),            \
                                        HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), \
                                        HID_RI_REPORT_COUNT(8, 0x01),           \
-                                       HID_RI_REPORT_SIZE(8, (8 - (Buttons % 8))), \
+                                       HID_RI_REPORT_SIZE(8, (Buttons % 8) ? (8 - (Buttons % 8)) : 0), \
                                        HID_RI_INPUT(8, HID_IOF_CONSTANT),      \
                                        HID_RI_USAGE_PAGE(8, 0x01),             \
                                        HID_RI_USAGE(8, 0x30),                  \