/* Task to read and process the HID report descriptor and HID reports from the device and display the results onto the board LEDs.  */
void JoystickHost_Task(void)
/* Task to read and process the HID report descriptor and HID reports from the device and display the results onto the board LEDs.  */
void JoystickHost_Task(void)
{
	if (USB_HostState != HOST_STATE_Configured)
	  return;
	Pipe_SelectPipe(JOYSTICK_DATA_IN_PIPE);
	Pipe_Unfreeze();
	if (Pipe_IsINReceived())
	{
		if (Pipe_IsReadWriteAllowed())
		{
			uint8_t JoystickReport[Pipe_BytesInPipe()];
			Pipe_Read_Stream_LE(JoystickReport, Pipe_BytesInPipe(), NULL);
			ProcessJoystickReport(JoystickReport);
		}
		Pipe_ClearIN();
	}
	Pipe_Freeze();
}