Fixed unused variable c as in pull request #138

This commit is contained in:
3d-gussner 2018-05-30 13:26:31 +02:00
parent f6f0de4cc1
commit 2f9b63275f

View File

@ -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;