- /* Wait until Serial Tx Endpoint Ready for Read/Write */\r
- while (!(Endpoint_IsReadWriteAllowed()));\r
+ /* If no more data to send and the last packet filled the endpoint, send an empty packet to release\r
+ * the buffer on the receiver (otherwise all data will be cached until a non-full packet is received) */\r
+ if (IsFull && !(Tx_Buffer.Elements))\r
+ {\r
+ /* Wait until Serial Tx Endpoint Ready for Read/Write */\r
+ while (!(Endpoint_IsReadWriteAllowed()));\r