Selaa lähdekoodia

Merge pull request #784 from 3d-gussner/MK3_fix2

Fixed unused variable c as in pull request #138
XPila 6 vuotta sitten
vanhempi
commit
d70d38bb0c
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      Firmware/MarlinSerial.h

+ 2 - 2
Firmware/MarlinSerial.h

@@ -131,7 +131,7 @@ class MarlinSerial //: public Stream
                 if (M_UCSRxA & (1<<M_FEx)) {
                     // Characters received with the framing errors will be ignored.
                     // The temporary variable "c" was made volatile, so the compiler does not optimize this out.
-                    volatile unsigned char c = M_UDRx;
+                    (void)(*(char *)M_UDRx);
                 } else {
                     unsigned char c  =  M_UDRx;
                     int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE;
@@ -155,7 +155,7 @@ class MarlinSerial //: public Stream
                 if (UCSR1A & (1<<FE1)) {
                     // Characters received with the framing errors will be ignored.
                     // The temporary variable "c" was made volatile, so the compiler does not optimize this out.
-                    volatile unsigned char c = UDR1;
+                    (void)(*(char *)UDR1);
                 } else {
                     unsigned char c  =  UDR1;
                     int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE;