aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device')
-rw-r--r--Demos/Device/ClassDriver/CDCMouse/CDCMouse.c6
-rw-r--r--Demos/Device/ClassDriver/Joystick/Joystick.c6
-rw-r--r--Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c7
-rw-r--r--Demos/Device/ClassDriver/Mouse/Mouse.c6
-rw-r--r--Demos/Device/LowLevel/Joystick/Joystick.c6
-rw-r--r--Demos/Device/LowLevel/Mouse/Mouse.c6
6 files changed, 19 insertions, 18 deletions
diff --git a/Demos/Device/ClassDriver/CDCMouse/CDCMouse.c b/Demos/Device/ClassDriver/CDCMouse/CDCMouse.c
index b625327fb..e21e0bcb4 100644
--- a/Demos/Device/ClassDriver/CDCMouse/CDCMouse.c
+++ b/Demos/Device/ClassDriver/CDCMouse/CDCMouse.c
@@ -210,10 +210,10 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
else if (JoyStatus_LCL & JOY_DOWN)
MouseReport->Y = 1;
- if (JoyStatus_LCL & JOY_RIGHT)
- MouseReport->X = 1;
- else if (JoyStatus_LCL & JOY_LEFT)
+ if (JoyStatus_LCL & JOY_LEFT)
MouseReport->X = -1;
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ MouseReport->X = 1;
if (JoyStatus_LCL & JOY_PRESS)
MouseReport->Button = (1 << 0);
diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c
index 36a74a218..00bcb6fe4 100644
--- a/Demos/Device/ClassDriver/Joystick/Joystick.c
+++ b/Demos/Device/ClassDriver/Joystick/Joystick.c
@@ -148,10 +148,10 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
else if (JoyStatus_LCL & JOY_DOWN)
JoystickReport->Y = 100;
- if (JoyStatus_LCL & JOY_RIGHT)
- JoystickReport->X = 100;
- else if (JoyStatus_LCL & JOY_LEFT)
+ if (JoyStatus_LCL & JOY_LEFT)
JoystickReport->X = -100;
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ JoystickReport->X = 100;
if (JoyStatus_LCL & JOY_PRESS)
JoystickReport->Button = (1 << 1);
diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
index 77aa2a91a..caa33f907 100644
--- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
+++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c
@@ -170,6 +170,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
uint8_t JoyStatus_LCL = Joystick_GetStatus();
uint8_t ButtonStatus_LCL = Buttons_GetStatus();
+ /* Determine which interface must have its report generated */
if (HIDInterfaceInfo == &Keyboard_HID_Interface)
{
USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;
@@ -207,10 +208,10 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
else if (JoyStatus_LCL & JOY_DOWN)
MouseReport->Y = 1;
- if (JoyStatus_LCL & JOY_RIGHT)
- MouseReport->X = 1;
- else if (JoyStatus_LCL & JOY_LEFT)
+ if (JoyStatus_LCL & JOY_LEFT)
MouseReport->X = -1;
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ MouseReport->X = 1;
if (JoyStatus_LCL & JOY_PRESS)
MouseReport->Button = (1 << 0);
diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.c b/Demos/Device/ClassDriver/Mouse/Mouse.c
index c53d429a4..c29cc15ef 100644
--- a/Demos/Device/ClassDriver/Mouse/Mouse.c
+++ b/Demos/Device/ClassDriver/Mouse/Mouse.c
@@ -148,10 +148,10 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
else if (JoyStatus_LCL & JOY_DOWN)
MouseReport->Y = 1;
- if (JoyStatus_LCL & JOY_RIGHT)
- MouseReport->X = 1;
- else if (JoyStatus_LCL & JOY_LEFT)
+ if (JoyStatus_LCL & JOY_LEFT)
MouseReport->X = -1;
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ MouseReport->X = 1;
if (JoyStatus_LCL & JOY_PRESS)
MouseReport->Button = (1 << 0);
diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c
index 6d04c8fa6..aa5244c15 100644
--- a/Demos/Device/LowLevel/Joystick/Joystick.c
+++ b/Demos/Device/LowLevel/Joystick/Joystick.c
@@ -156,10 +156,10 @@ bool GetNextReport(USB_JoystickReport_Data_t* ReportData)
else if (JoyStatus_LCL & JOY_DOWN)
ReportData->Y = 100;
- if (JoyStatus_LCL & JOY_RIGHT)
- ReportData->X = 100;
- else if (JoyStatus_LCL & JOY_LEFT)
+ if (JoyStatus_LCL & JOY_LEFT)
ReportData->X = -100;
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ ReportData->X = 100;
if (JoyStatus_LCL & JOY_PRESS)
ReportData->Button = (1 << 1);
diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c
index 2f7a63f7f..4b318e30c 100644
--- a/Demos/Device/LowLevel/Mouse/Mouse.c
+++ b/Demos/Device/LowLevel/Mouse/Mouse.c
@@ -238,10 +238,10 @@ void CreateMouseReport(USB_MouseReport_Data_t* ReportData)
else if (JoyStatus_LCL & JOY_DOWN)
ReportData->Y = 1;
- if (JoyStatus_LCL & JOY_RIGHT)
- ReportData->X = 1;
- else if (JoyStatus_LCL & JOY_LEFT)
+ if (JoyStatus_LCL & JOY_LEFT)
ReportData->X = -1;
+ else if (JoyStatus_LCL & JOY_RIGHT)
+ ReportData->X = 1;
if (JoyStatus_LCL & JOY_PRESS)
ReportData->Button = (1 << 0);