Commit 2b51944a authored by Dean Camera's avatar Dean Camera
Browse files

Make sure the button report set masks use OR in all circumstances, to prevent...

Make sure the button report set masks use OR in all circumstances, to prevent user confusion. While the first set of the buttons report item can be a direct assignment, it is not immediately clear to new developers why this is the case.
parent 015956ba
......@@ -217,7 +217,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
MouseReport->X = 1;
if (JoyStatus_LCL & JOY_PRESS)
MouseReport->Button = (1 << 0);
MouseReport->Button |= (1 << 0);
*ReportSize = sizeof(USB_MouseReport_Data_t);
return true;
......
......@@ -155,7 +155,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
MouseReport->X = 1;
if (JoyStatus_LCL & JOY_PRESS)
MouseReport->Button = (1 << 0);
MouseReport->Button |= (1 << 0);
if (ButtonStatus_LCL & BUTTONS_BUTTON1)
MouseReport->Button |= (1 << 1);
......
......@@ -217,7 +217,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
MouseReport->X = 1;
if (JoyStatus_LCL & JOY_PRESS)
MouseReport->Button = (1 << 0);
MouseReport->Button |= (1 << 0);
if (ButtonStatus_LCL & BUTTONS_BUTTON1)
MouseReport->Button |= (1 << 1);
......
......@@ -123,7 +123,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
MouseReport->X = -1;
if (JoyStatus_LCL & JOY_PRESS)
MouseReport->Button = (1 << 0);
MouseReport->Button |= (1 << 0);
if (ButtonStatus_LCL & BUTTONS_BUTTON1)
MouseReport->Button |= (1 << 1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment