From b6899bb98734a79514ab90583144139b879f7001 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 10 Aug 2014 19:17:58 +1000 Subject: Fixed USART reception overrun corrupting the internal buffers in the USBtoSerial project. --- Projects/USBtoSerial/USBtoSerial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Projects') 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); } -- cgit v1.2.3