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