Added new USB_DeviceState variable to keep track of the current Device mode USB state.
[pub/USBasp.git] / Demos / Device / LowLevel / Joystick / Joystick.c
index e117475..db2415e 100644 (file)
@@ -182,7 +182,7 @@ bool GetNextReport(USB_JoystickReport_Data_t* ReportData)
 void HID_Task(void)\r
 {\r
        /* Device must be connected and configured for the task to run */\r
-       if (!(USB_IsConnected) || !(USB_ConfigurationNumber))\r
+       if (USB_DeviceState != DEVICE_STATE_Configured)\r
          return;\r
   \r
        /* Select the Joystick Report Endpoint */\r