aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-08-16 10:57:47 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-08-16 10:57:47 +0000
commit3a85962f94eccfa86a5db46899bddeaceb79fee6 (patch)
tree6253b7b5dde08040af73f3d2371e5b0c3ddd57fb /Demos/Device/LowLevel
parentb71ff7c8cd68209a74c8690f4d190cc634ef8fb3 (diff)
downloadlufa-3a85962f94eccfa86a5db46899bddeaceb79fee6.tar.gz
lufa-3a85962f94eccfa86a5db46899bddeaceb79fee6.tar.bz2
lufa-3a85962f94eccfa86a5db46899bddeaceb79fee6.zip
Fix USBtoSerial device demos -- ensure the UDR1 register contents is read in under all circumstances which fire the ISR, so that the receive complete interrupt is cleared correctly to prevent freezes.
Diffstat (limited to 'Demos/Device/LowLevel')
-rw-r--r--Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c b/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c
index 141a45276..d5e871c2d 100644
--- a/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c
+++ b/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c
@@ -296,9 +296,11 @@ void CDC_Task(void)
*/
ISR(USART1_RX_vect, ISR_BLOCK)
{
+ uint8_t ReceivedByte = UDR1;
+
/* Only store received characters if the USB interface is connected */
if ((USB_DeviceState != DEVICE_STATE_Configured) && LineEncoding.BaudRateBPS)
- Buffer_StoreElement(&Tx_Buffer, UDR1);
+ Buffer_StoreElement(&Tx_Buffer, ReceivedByte);
}
/** Reconfigures the USART to match the current serial port settings issued by the host as closely as possible. */