Minor updates to the Magstripe and MissileLauncher projects to fix bugs and improve...
[pub/USBasp.git] / Projects / MissileLauncher / MissileLauncher.c
index 046c132..88902cf 100644 (file)
@@ -137,8 +137,9 @@ void SetupHardware(void)
 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
@@ -285,7 +286,7 @@ void WriteNextReport(uint8_t* ReportOUTData, uint16_t ReportLength)
                /* 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