From 546f02c6f417bacc124ba04bf24d807a399ea832 Mon Sep 17 00:00:00 2001
From: GMagician <GMagician@users.noreply.github.com>
Date: Sun, 8 Oct 2017 23:16:35 +0200
Subject: [PATCH] [2.0.x] Addressing #7896

Compiler error, added char c variable
---
 Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
index dbd3f61d0..badcc3a07 100644
--- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
+++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp
@@ -175,12 +175,12 @@
     // If the character is to be stored at the index just before the tail
     // (such that the head would advance to the current tail), the buffer is
     // critical, so don't write the character or advance the head.
+    const char c = M_UDRx;
     if (i != rx_buffer.tail) {
-      rx_buffer.buffer[h] = M_UDRx;
+      rx_buffer.buffer[h] = c;
       rx_buffer.head = i;
     }
     else {
-      (void)M_UDRx;
       #if ENABLED(SERIAL_STATS_DROPPED_RX)
         if (!++rx_dropped_bytes) ++rx_dropped_bytes;
       #endif
@@ -194,7 +194,6 @@
     #endif
 
     #if ENABLED(SERIAL_XON_XOFF)
-
       // for high speed transfers, we can use XON/XOFF protocol to do
       // software handshake and avoid overruns.
       if ((xon_xoff_state & XON_XOFF_CHAR_MASK) == XON_CHAR) {