diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-01-23 20:02:51 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-01-23 20:02:51 +0000 |
| commit | 25d506a5ac64f3c77cd6d028a7e52d64076bb309 (patch) | |
| tree | ee950b43a3aaa32a72b7d24f65e0b179f00810cc /Demos/Device/LowLevel | |
| parent | 6470fd2898cb36de3b19b830399e99a786cdd832 (diff) | |
Added new HID_DESCRIPTOR_MOUSE, HID_DESCRIPTOR_KEYBOARD and HID_DESCRIPTOR_JOYSTICK macros for easy automatic creation of basic USB HID device reports.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1642 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Device/LowLevel')
| -rw-r--r-- | Demos/Device/LowLevel/Joystick/Joystick.c | 2 | ||||
| -rw-r--r-- | Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c | 2 | ||||
| -rw-r--r-- | Demos/Device/LowLevel/Mouse/Mouse.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c index df1a884b..f3185b6e 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 05888797..fbb742ca 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 40ec25a8..808cf50b 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); |
