/** Task to manage HID report generation and transmission to the host, when in report mode. */\r
void Mouse_Task(void)\r
{\r
- /* Check if the USB system is connected to a host */\r
- if (USB_IsConnected)\r
- {\r
- /* Send the next mouse report to the host */\r
- SendNextReport();\r
- }\r
+ /* Device must be connected and configured for the task to run */\r
+ if (!(USB_IsConnected) || !(USB_ConfigurationNumber))\r
+ return;\r
+ \r
+ /* Send the next mouse report to the host */\r
+ SendNextReport();\r
}\r