From 6c7ed7ecd6d4727e33ddb8c5e4321499a2b76151 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 23 Jan 2011 20:02:51 +0000 Subject: Added new HID_DESCRIPTOR_MOUSE, HID_DESCRIPTOR_KEYBOARD and HID_DESCRIPTOR_JOYSTICK macros for easy automatic creation of basic USB HID device reports. --- Demos/Device/LowLevel/Joystick/Joystick.c | 2 +- Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c | 2 +- Demos/Device/LowLevel/Mouse/Mouse.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Demos/Device/LowLevel') diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c index df1a884b6..f3185b6e6 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.c +++ b/Demos/Device/LowLevel/Joystick/Joystick.c @@ -159,7 +159,7 @@ bool GetNextReport(USB_JoystickReport_Data_t* const ReportData) ReportData->X = 100; if (JoyStatus_LCL & JOY_PRESS) - ReportData->Button = (1 << 1); + ReportData->Button |= (1 << 1); if (ButtonStatus_LCL & BUTTONS_BUTTON1) ReportData->Button |= (1 << 0); diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c index 058887971..fbb742ca4 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c @@ -290,7 +290,7 @@ void Mouse_HID_Task(void) MouseReportData.X = -1; if (JoyStatus_LCL & JOY_PRESS) - MouseReportData.Button = (1 << 0); + MouseReportData.Button |= (1 << 0); } /* Select the Mouse Report Endpoint */ diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c index 40ec25a86..808cf50b0 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.c +++ b/Demos/Device/LowLevel/Mouse/Mouse.c @@ -233,10 +233,10 @@ void CreateMouseReport(USB_MouseReport_Data_t* const ReportData) if (JoyStatus_LCL & JOY_LEFT) ReportData->X = -1; else if (JoyStatus_LCL & JOY_RIGHT) - ReportData->X = 1; + ReportData->X = 1; if (JoyStatus_LCL & JOY_PRESS) - ReportData->Button = (1 << 0); + ReportData->Button |= (1 << 0); if (ButtonStatus_LCL & BUTTONS_BUTTON1) ReportData->Button |= (1 << 1); -- cgit v1.2.3