void Read_Joystick_Status(void)\r
{\r
uint8_t JoyStatus_LCL = Joystick_GetStatus();\r
+ uint8_t Buttons_LCL = Buttons_GetStatus();\r
\r
- if (BUTTONS_BUTTON1 && Buttons_GetStatus())\r
+ if (Buttons_LCL & BUTTONS_BUTTON1)\r
Send_Command(CMD_FIRE);\r
else if (JoyStatus_LCL & JOY_UP)\r
Send_Command(CMD_UP);\r
if ((CmdState == CMD_STOP && Command != CMD_STOP) ||\r
(CmdState != CMD_STOP && Command == CMD_STOP))\r
{\r
- LEDs_ChangeLEDs(LEDS_LED4, ~LEDs_GetLEDs() & LEDS_LED4);\r
+ LEDs_ToggleLEDs(LEDS_LED4);\r
\r
Send_Command_Report(CMD_INITA, 8);\r
Send_Command_Report(CMD_INITB, 8);\r
/* Class specific request to send a HID report to the device */\r
USB_ControlRequest = (USB_Request_Header_t)\r
{\r
- .bmRequestType = 0x21,\r
+ .bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE),\r
.bRequest = 0x09,\r
.wValue = 0x02,\r
.wIndex = 0x01,\r
USB_HostState = HOST_STATE_Configured;\r
break;\r
case HOST_STATE_Configured:\r
- USB_HostState = HOST_STATE_Ready;\r
- break;\r
- case HOST_STATE_Ready:\r
DiscardNextReport();\r
\r
break;\r