From 0dd42a230325442d42bcd68d1d3c824ed909f1ca Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Tue, 21 Nov 2023 17:05:47 +1100 Subject: [PATCH] Fix build on mega2560 --- speeduino/board_avr2560.cpp | 5 ++++- speeduino/board_avr2560.h | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/speeduino/board_avr2560.cpp b/speeduino/board_avr2560.cpp index 3341782f..d05fa61b 100644 --- a/speeduino/board_avr2560.cpp +++ b/speeduino/board_avr2560.cpp @@ -1,5 +1,6 @@ #include "globals.h" #if defined(CORE_AVR) +#include "board_avr2560.h" #include "auxiliaries.h" #include "comms_secondary.h" @@ -23,7 +24,9 @@ void initBoard(void) * General */ configPage9.intcan_available = 0; // AVR devices do NOT have internal canbus - pSecondarySerial = &Serial3; + #ifdef secondarySerial_AVAILABLE + pSecondarySerial = &Serial3; + #endif /* *********************************************************************************************************** diff --git a/speeduino/board_avr2560.h b/speeduino/board_avr2560.h index 1e419a7d..49cdd621 100644 --- a/speeduino/board_avr2560.h +++ b/speeduino/board_avr2560.h @@ -158,10 +158,10 @@ static inline void IGN8_TIMER_DISABLE(void) { TIMSK3 &= ~(1 << OCIE3B); } //Repl *********************************************************************************************************** * CAN / Second serial */ - +#if ( defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) ) #define secondarySerial_AVAILABLE - #define SECONDARY_SERIAL_T HardwareSerial - +#endif +#define SECONDARY_SERIAL_T HardwareSerial #endif //CORE_AVR #endif //AVR2560_H