diff options
Diffstat (limited to 'tmk_core/protocol/usb_descriptor.c')
-rw-r--r-- | tmk_core/protocol/usb_descriptor.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index 764824f4dc..1d5a62aaa1 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c @@ -44,6 +44,10 @@ #endif #include "usb_descriptor_common.h" +#ifdef JOYSTICK_ENABLE +# include "joystick.h" +#endif + // clang-format off /* @@ -317,10 +321,17 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] = { HID_RI_USAGE(8, 0x35), // Rz # endif # if JOYSTICK_AXES_COUNT >= 1 - HID_RI_LOGICAL_MINIMUM(8, -127), - HID_RI_LOGICAL_MAXIMUM(8, 127), + # if JOYSTICK_AXES_RESOLUTION == 8 + HID_RI_LOGICAL_MINIMUM(8, -JOYSTICK_RESOLUTION), + HID_RI_LOGICAL_MAXIMUM(8, JOYSTICK_RESOLUTION), HID_RI_REPORT_COUNT(8, JOYSTICK_AXES_COUNT), HID_RI_REPORT_SIZE(8, 0x08), + # else + HID_RI_LOGICAL_MINIMUM(16, -JOYSTICK_RESOLUTION), + HID_RI_LOGICAL_MAXIMUM(16, JOYSTICK_RESOLUTION), + HID_RI_REPORT_COUNT(8, JOYSTICK_AXES_COUNT), + HID_RI_REPORT_SIZE(8, 0x10), + # endif HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), # endif |