From: Dean Camera Date: Tue, 15 Jul 2014 11:23:51 +0000 (+1000) Subject: Only deque from the USBtoSerial's USB->USART buffer when the USART is idle. X-Git-Tag: LUFA-140928~31 X-Git-Url: http://git.linex4red.de/pub/USBasp.git/commitdiff_plain/d90ef9aa2f97a5f8b5fd2cf0bd9564025d069f6e?ds=inline;hp=-c Only deque from the USBtoSerial's USB->USART buffer when the USART is idle. --- d90ef9aa2f97a5f8b5fd2cf0bd9564025d069f6e diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index a03d389b4..e16fcbec1 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -22,6 +22,7 @@ * - Fixed missing HID report ID prefix on HID class driver GetReport request responses (thanks to Bert van Hall) * - Library Applications: * - Fixed spurious 0xFE USART byte sent in the USBtoSerial project when the baud rate is changed (thanks to Carl Kjeldsen) + * - Fixed blocking USART reads causing low throughput on slow baud rates in the USBtoSerial project (thanks to Nevada Smith) * * \section Sec_ChangeLog140302 Version 140302 * New: diff --git a/Projects/USBtoSerial/USBtoSerial.c b/Projects/USBtoSerial/USBtoSerial.c index 1c791d95d..b51c7c258 100644 --- a/Projects/USBtoSerial/USBtoSerial.c +++ b/Projects/USBtoSerial/USBtoSerial.c @@ -133,8 +133,8 @@ int main(void) } } - /* Load the next byte from the USART transmit buffer into the USART */ - if (!(RingBuffer_IsEmpty(&USBtoUSART_Buffer))) + /* Load the next byte from the USART transmit buffer into the USART if transmit buffer space is available */ + if (Serial_IsSendReady() && !(RingBuffer_IsEmpty(&USBtoUSART_Buffer))) Serial_SendByte(RingBuffer_Remove(&USBtoUSART_Buffer)); CDC_Device_USBTask(&VirtualSerial_CDC_Interface);