+ /* Check if the Tx buffer contains anything to be sent to the host */\r
+ if ((Tx_Buffer.Elements) && LineEncoding.BaudRateBPS)\r
+ {\r
+ /* Wait until Serial Tx Endpoint Ready for Read/Write */\r
+ Endpoint_WaitUntilReady();\r
+ \r
+ /* Write the bytes from the buffer to the endpoint while space is available */\r
+ while (Tx_Buffer.Elements && Endpoint_IsReadWriteAllowed())\r
+ {\r
+ /* Write each byte retreived from the buffer to the endpoint */\r
+ Endpoint_Write_Byte(Buffer_GetElement(&Tx_Buffer));\r
+ }\r
+ \r
+ /* Remember if the packet to send completely fills the endpoint */\r
+ bool IsFull = (Endpoint_BytesInEndpoint() == CDC_TXRX_EPSIZE);\r
+ \r
+ /* Send the data */\r
+ Endpoint_ClearIN();\r