/* Function to manage CDC data transmission and reception to and from the host for the second CDC interface, which echoes back all data sent to it from the host.  */
void CDC2_Task(void)
/* Function to manage CDC data transmission and reception to and from the host for the second CDC interface, which echoes back all data sent to it from the host.  */
void CDC2_Task(void)
{
	if (USB_DeviceState != DEVICE_STATE_Configured)
	  return;
	Endpoint_SelectEndpoint(CDC2_RX_EPADDR);
	if (Endpoint_IsOUTReceived())
	{
		uint8_t  Buffer[Endpoint_BytesInEndpoint()];
		uint16_t DataLength = Endpoint_BytesInEndpoint();
		Endpoint_Read_Stream_LE(&Buffer, DataLength, NULL);
		Endpoint_ClearOUT();
		Endpoint_SelectEndpoint(CDC2_TX_EPADDR);
		Endpoint_Write_Stream_LE(&Buffer, DataLength, NULL);
		Endpoint_ClearIN();
		Endpoint_WaitUntilReady();
		Endpoint_ClearIN();
	}
}