X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/b71ff7c8cd68209a74c8690f4d190cc634ef8fb3..ea5236b3e14976c1fc9b053c0a9294e8305e0a15:/Demos/Device/ClassDriver/Joystick/Joystick.c?ds=sidebyside diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c index b18b7ebc8..00bcb6fe4 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.c +++ b/Demos/Device/ClassDriver/Joystick/Joystick.c @@ -47,13 +47,14 @@ USB_ClassInfo_HID_Device_t Joystick_HID_Interface = { .Config = { - .InterfaceNumber = 0, + .InterfaceNumber = 0, - .ReportINEndpointNumber = JOYSTICK_EPNUM, - .ReportINEndpointSize = JOYSTICK_EPSIZE, + .ReportINEndpointNumber = JOYSTICK_EPNUM, + .ReportINEndpointSize = JOYSTICK_EPSIZE, + .ReportINEndpointDoubleBank = false, - .PrevReportINBuffer = PrevJoystickHIDReportBuffer, - .PrevReportINBufferSize = sizeof(PrevJoystickHIDReportBuffer), + .PrevReportINBuffer = PrevJoystickHIDReportBuffer, + .PrevReportINBufferSize = sizeof(PrevJoystickHIDReportBuffer), }, }; @@ -147,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);