From 4a71285c34e161b9f38079e40d8bac2861f8ff78 Mon Sep 17 00:00:00 2001 From: ellensp Date: Sun, 26 Jan 2020 22:05:34 +1300 Subject: [PATCH] Fix Serial defines for M43 on AVR (#16649) --- Marlin/src/pins/pinsDebug.h | 52 +++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/Marlin/src/pins/pinsDebug.h b/Marlin/src/pins/pinsDebug.h index d53b655837..1972c3ba94 100644 --- a/Marlin/src/pins/pinsDebug.h +++ b/Marlin/src/pins/pinsDebug.h @@ -137,31 +137,33 @@ const PinInfo pin_array[] PROGMEM = { #endif #endif - #if SERIAL_PORT_2 == 0 - #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) - { RXD_NAME_0, 0, true }, - { TXD_NAME_0, 1, true }, - #elif AVR_ATmega1284_FAMILY - { RXD_NAME_0, 8, true }, - { TXD_NAME_0, 9, true }, - #endif - #elif SERIAL_PORT_2 == 1 - #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) - { RXD_NAME_1, 19, true }, - { TXD_NAME_1, 18, true }, - #elif AVR_ATmega1284_FAMILY - { RXD_NAME_1, 10, true }, - { TXD_NAME_1, 11, true }, - #endif - #elif SERIAL_PORT_2 == 2 - #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) - { RXD_NAME_2, 17, true }, - { TXD_NAME_2, 16, true }, - #endif - #elif SERIAL_PORT_2 == 3 - #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) - { RXD_NAME_3, 15, true }, - { TXD_NAME_3, 14, true }, + #ifdef SERIAL_PORT_2 + #if SERIAL_PORT_2 == 0 + #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) + { RXD_NAME_0, 0, true }, + { TXD_NAME_0, 1, true }, + #elif AVR_ATmega1284_FAMILY + { RXD_NAME_0, 8, true }, + { TXD_NAME_0, 9, true }, + #endif + #elif SERIAL_PORT_2 == 1 + #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) + { RXD_NAME_1, 19, true }, + { TXD_NAME_1, 18, true }, + #elif AVR_ATmega1284_FAMILY + { RXD_NAME_1, 10, true }, + { TXD_NAME_1, 11, true }, + #endif + #elif SERIAL_PORT_2 == 2 + #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) + { RXD_NAME_2, 17, true }, + { TXD_NAME_2, 16, true }, + #endif + #elif SERIAL_PORT_2 == 3 + #if (AVR_ATmega2560_FAMILY || defined(ARDUINO_ARCH_SAM)) + { RXD_NAME_3, 15, true }, + { TXD_NAME_3, 14, true }, + #endif #endif #endif