Merge pull request #3375 from leptun/MK3_arduino_1.8.13

Fix arduino 1.8.13 warnings
This commit is contained in:
Alex Voinea 2022-02-07 17:27:13 +01:00 committed by GitHub
commit 2b18357fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -30,7 +30,7 @@ uint8_t selectedSerialPort = 0;
// this is so I can support Attiny series and any other chip without a UART
#if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)
#if UART_PRESENT(SERIAL_PORT)
#ifdef HAS_UART
ring_buffer rx_buffer = { { 0 }, 0, 0 };
#endif

View File

@ -28,9 +28,12 @@
#endif
// The presence of the UBRRH register is used to detect a UART.
#define UART_PRESENT(port) ((port == 0 && (defined(UBRRH) || defined(UBRR0H))) || \
(port == 1 && defined(UBRR1H)) || (port == 2 && defined(UBRR2H)) || \
(port == 3 && defined(UBRR3H)))
#if ((SERIAL_PORT == 0 && (defined(UBRRH) || defined(UBRR0H))) || \
(SERIAL_PORT == 1 && defined(UBRR1H)) || \
(SERIAL_PORT == 2 && defined(UBRR2H)) || \
(SERIAL_PORT == 3 && defined(UBRR3H)))
#define HAS_UART
#endif
// These are macros to build serial port register names for the selected SERIAL_PORT (C preprocessor
// requires two levels of indirection to expand macro values properly)
@ -82,7 +85,7 @@ struct ring_buffer
int tail;
};
#if UART_PRESENT(SERIAL_PORT)
#ifdef HAS_UART
extern ring_buffer rx_buffer;
#endif