static uint8_t PrevJoystickStatus;\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
Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPNUM);\r