/* Function to manage HID report generation and transmission to the host.  */
void HID_Task(void)
/* Function to manage HID report generation and transmission to the host.  */
void HID_Task(void)
{
	if (USB_DeviceState != DEVICE_STATE_Configured)
	  return;
	Endpoint_SelectEndpoint(JOYSTICK_EPADDR);
	if (Endpoint_IsINReady())
	{
		USB_JoystickReport_Data_t JoystickReportData;
		GetNextReport(&JoystickReportData);
		Endpoint_Write_Stream_LE(&JoystickReportData, sizeof(JoystickReportData), NULL);
		Endpoint_ClearIN();
		memset(&JoystickReportData, 0, sizeof(JoystickReportData));
	}
}