aboutsummaryrefslogtreecommitdiff
path: root/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
diff options
context:
space:
mode:
authorDean Camera <[email protected]>2009-08-16 10:57:47 +0000
committerDean Camera <[email protected]>2009-08-16 10:57:47 +0000
commit3a85962f94eccfa86a5db46899bddeaceb79fee6 (patch)
tree6253b7b5dde08040af73f3d2371e5b0c3ddd57fb /Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
parentb71ff7c8cd68209a74c8690f4d190cc634ef8fb3 (diff)
downloadqmk_firmware-3a85962f94eccfa86a5db46899bddeaceb79fee6.tar.gz
qmk_firmware-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/ClassDriver/USBtoSerial/USBtoSerial.c')
-rw-r--r--Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
index 0c83cd8dde..8ef07f1c33 100644
--- a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
+++ b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
@@ -147,8 +147,10 @@ void EVENT_USB_Device_UnhandledControlPacket(void)
*/
ISR(USART1_RX_vect, ISR_BLOCK)
{
+ uint8_t ReceivedByte = UDR1;
+
if (USB_DeviceState == DEVICE_STATE_Configured)
- Buffer_StoreElement(&Tx_Buffer, UDR1);
+ Buffer_StoreElement(&Tx_Buffer, ReceivedByte);
}
/** Event handler for the CDC Class driver Line Encoding Changed event.