Procházet zdrojové kódy

Fixed unused variable c as in pull request #138

3d-gussner před 6 roky
rodič
revize
2f9b63275f
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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;