Fix USBtoSerial device demos -- ensure the UDR1 register contents is read in under...
[pub/USBasp.git] / Demos / Device / LowLevel / USBtoSerial / USBtoSerial.c
index 141a452..d5e871c 100644 (file)
@@ -296,9 +296,11 @@ void CDC_Task(void)
  */\r
 ISR(USART1_RX_vect, ISR_BLOCK)\r
 {\r
+       uint8_t ReceivedByte = UDR1;\r
+\r
        /* Only store received characters if the USB interface is connected */\r
        if ((USB_DeviceState != DEVICE_STATE_Configured) && LineEncoding.BaudRateBPS)\r
-         Buffer_StoreElement(&Tx_Buffer, UDR1);\r
+         Buffer_StoreElement(&Tx_Buffer, ReceivedByte);\r
 }\r
 \r
 /** Reconfigures the USART to match the current serial port settings issued by the host as closely as possible. */\r