diff --git a/right/usb_descriptor_mouse_report.c b/right/usb_descriptor_mouse_report.c index 2c42bec..8e2966d 100644 --- a/right/usb_descriptor_mouse_report.c +++ b/right/usb_descriptor_mouse_report.c @@ -21,7 +21,7 @@ uint8_t UsbMouseReportDescriptor[USB_MOUSE_REPORT_DESCRIPTOR_LENGTH] = { // Mouse buttons padding HID_RI_REPORT_COUNT(8, 0x01), - HID_RI_REPORT_SIZE(8, (USB_MOUSE_REPORT_DESCRIPTOR_BUTTONS % 8) ? (8 - (USB_MOUSE_REPORT_DESCRIPTOR_BUTTONS % 8)) : 0), + HID_RI_REPORT_SIZE(8, USB_MOUSE_REPORT_DESCRIPTOR_BUTTONS_PADDING), HID_RI_INPUT(8, HID_IOF_CONSTANT), // Mouse X and Y coordinates diff --git a/right/usb_descriptor_mouse_report.h b/right/usb_descriptor_mouse_report.h index 3994a75..657c494 100644 --- a/right/usb_descriptor_mouse_report.h +++ b/right/usb_descriptor_mouse_report.h @@ -11,6 +11,9 @@ #define USB_MOUSE_REPORT_DESCRIPTOR_MAX_AXIS_PHYSICAL_VALUE 4096 #define USB_MOUSE_REPORT_DESCRIPTOR_BUTTONS 8 + #define USB_MOUSE_REPORT_DESCRIPTOR_BUTTONS_PADDING ((USB_MOUSE_REPORT_DESCRIPTOR_BUTTONS % 8) \ + ? (8 - (USB_MOUSE_REPORT_DESCRIPTOR_BUTTONS % 8)) \ + : 0) // Variables: extern uint8_t UsbMouseReportDescriptor[USB_MOUSE_REPORT_DESCRIPTOR_LENGTH];