+#if !defined(INTERRUPT_DATA_ENDPOINT)\r
+TASK(USB_HID_Report)\r
+{\r
+ /* Check if the USB system is connected to a host */\r
+ if (USB_IsConnected)\r
+ {\r
+ Endpoint_SelectEndpoint(GENERIC_OUT_EPNUM);\r
+ \r
+ /* Check to see if a packet has been sent from the host */\r
+ if (Endpoint_IsOUTReceived())\r
+ {\r
+ /* Check to see if the packet contains data */\r
+ if (Endpoint_IsReadWriteAllowed())\r
+ {\r
+ /* Create a temporary buffer to hold the read in report from the host */\r
+ uint8_t GenericData[GENERIC_REPORT_SIZE];\r
+ \r
+ /* Read Generic Report Data */\r
+ Endpoint_Read_Stream_LE(&GenericData, sizeof(GenericData));\r
+ \r
+ /* Process Generic Report Data */\r
+ ProcessGenericHIDReport(GenericData);\r
+ }\r
+\r
+ /* Finalize the stream transfer to send the last packet */\r
+ Endpoint_ClearOUT();\r
+ } \r
+\r
+ Endpoint_SelectEndpoint(GENERIC_IN_EPNUM);\r
+ \r
+ /* Check to see if the host is ready to accept another packet */\r
+ if (Endpoint_IsINReady())\r
+ {\r
+ /* Create a temporary buffer to hold the report to send to the host */\r
+ uint8_t GenericData[GENERIC_REPORT_SIZE];\r
+ \r
+ /* Create Generic Report Data */\r
+ CreateGenericHIDReport(GenericData);\r
+\r
+ /* Write Generic Report Data */\r
+ Endpoint_Write_Stream_LE(&GenericData, sizeof(GenericData));\r
+\r
+ /* Finalize the stream transfer to send the last packet */\r
+ Endpoint_ClearIN();\r
+ }\r
+ }\r
+}\r
+#endif\r
+\r