aboutsummaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2014-08-10 19:17:58 +1000
committerDean Camera <dean@fourwalledcubicle.com>2014-08-10 19:17:58 +1000
commitb6899bb98734a79514ab90583144139b879f7001 (patch)
treec7febd2cb4139d1c60f4f304a715b79ff6be0037 /Projects
parent4c06a9c88fe6c9a294d5f7bda94528630da3ee3f (diff)
downloadlufa-b6899bb98734a79514ab90583144139b879f7001.tar.gz
lufa-b6899bb98734a79514ab90583144139b879f7001.tar.bz2
lufa-b6899bb98734a79514ab90583144139b879f7001.zip
Fixed USART reception overrun corrupting the internal buffers in the USBtoSerial project.
Diffstat (limited to 'Projects')
-rw-r--r--Projects/USBtoSerial/USBtoSerial.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Projects/USBtoSerial/USBtoSerial.c b/Projects/USBtoSerial/USBtoSerial.c
index b51c7c258..343b51ba5 100644
--- a/Projects/USBtoSerial/USBtoSerial.c
+++ b/Projects/USBtoSerial/USBtoSerial.c
@@ -194,7 +194,7 @@ ISR(USART1_RX_vect, ISR_BLOCK)
{
uint8_t ReceivedByte = UDR1;
- if (USB_DeviceState == DEVICE_STATE_Configured)
+ if ((USB_DeviceState == DEVICE_STATE_Configured) && !(RingBuffer_IsFull(&USARTtoUSB_Buffer)))
RingBuffer_Insert(&USARTtoUSB_Buffer, ReceivedByte);
}