aboutsummaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2014-07-15 21:23:51 +1000
committerDean Camera <dean@fourwalledcubicle.com>2014-07-15 21:23:51 +1000
commitd90ef9aa2f97a5f8b5fd2cf0bd9564025d069f6e (patch)
tree0d740956f1eba512331ba0a962a9fa4d211366ae /Projects
parent3d818fbb86ddb648c6df4d9389dc025510a169b6 (diff)
downloadlufa-d90ef9aa2f97a5f8b5fd2cf0bd9564025d069f6e.tar.gz
lufa-d90ef9aa2f97a5f8b5fd2cf0bd9564025d069f6e.tar.bz2
lufa-d90ef9aa2f97a5f8b5fd2cf0bd9564025d069f6e.zip
Only deque from the USBtoSerial's USB->USART buffer when the USART is idle.
Diffstat (limited to 'Projects')
-rw-r--r--Projects/USBtoSerial/USBtoSerial.c4
1 files changed, 2 insertions, 2 deletions
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);