From 026586c125bdbae0770ea147fa81ad8d76e657c0 Mon Sep 17 00:00:00 2001 From: ellensp Date: Tue, 24 Mar 2020 22:33:58 +1300 Subject: [PATCH 1/3] Fix EMERGENCY_PARSER on Due --- Marlin/src/HAL/DUE/HAL.h | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index 97b94b5db234..d73862aab859 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -39,16 +39,8 @@ #include // Define MYSERIAL0/1 before MarlinSerial includes! -#if SERIAL_PORT == -1 +#if SERIAL_PORT >= -1 && SERIAL_PORT <= 3 #define MYSERIAL0 customizedSerial1 -#elif SERIAL_PORT == 0 - #define MYSERIAL0 Serial -#elif SERIAL_PORT == 1 - #define MYSERIAL0 Serial1 -#elif SERIAL_PORT == 2 - #define MYSERIAL0 Serial2 -#elif SERIAL_PORT == 3 - #define MYSERIAL0 Serial3 #else #error "The required SERIAL_PORT must be from -1 to 3. Please update your configuration." #endif @@ -56,16 +48,8 @@ #ifdef SERIAL_PORT_2 #if SERIAL_PORT_2 == SERIAL_PORT #error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration." - #elif SERIAL_PORT_2 == -1 + #elif SERIAL_PORT_2 >= -1 and SERIAL_PORT_2 <= 3 #define MYSERIAL1 customizedSerial2 - #elif SERIAL_PORT_2 == 0 - #define MYSERIAL1 Serial - #elif SERIAL_PORT_2 == 1 - #define MYSERIAL1 Serial1 - #elif SERIAL_PORT_2 == 2 - #define MYSERIAL1 Serial2 - #elif SERIAL_PORT_2 == 3 - #define MYSERIAL1 Serial3 #else #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration." #endif From a52bcc83f5053af7d759f358c1481a65786159bb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 24 Mar 2020 13:51:07 -0500 Subject: [PATCH 2/3] Update HAL.h --- Marlin/src/HAL/DUE/HAL.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index d73862aab859..cb20bd823512 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -39,7 +39,7 @@ #include // Define MYSERIAL0/1 before MarlinSerial includes! -#if SERIAL_PORT >= -1 && SERIAL_PORT <= 3 +#if WITHIN(SERIAL_PORT, -1, 3) #define MYSERIAL0 customizedSerial1 #else #error "The required SERIAL_PORT must be from -1 to 3. Please update your configuration." @@ -48,7 +48,7 @@ #ifdef SERIAL_PORT_2 #if SERIAL_PORT_2 == SERIAL_PORT #error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration." - #elif SERIAL_PORT_2 >= -1 and SERIAL_PORT_2 <= 3 + #elif WITHIN(SERIAL_PORT_2, -1, 3) #define MYSERIAL1 customizedSerial2 #else #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration." From f7467903e0c45912f0066709da94df449d26ccd0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 24 Mar 2020 13:57:59 -0500 Subject: [PATCH 3/3] Keep Arduino serial when EP is disabled --- Marlin/src/HAL/DUE/HAL.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index cb20bd823512..9bde2765025a 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -39,8 +39,16 @@ #include // Define MYSERIAL0/1 before MarlinSerial includes! -#if WITHIN(SERIAL_PORT, -1, 3) +#if SERIAL_PORT == -1 || ENABLED(EMERGENCY_PARSER) #define MYSERIAL0 customizedSerial1 +#elif SERIAL_PORT == 0 + #define MYSERIAL0 Serial +#elif SERIAL_PORT == 1 + #define MYSERIAL0 Serial1 +#elif SERIAL_PORT == 2 + #define MYSERIAL0 Serial2 +#elif SERIAL_PORT == 3 + #define MYSERIAL0 Serial3 #else #error "The required SERIAL_PORT must be from -1 to 3. Please update your configuration." #endif @@ -48,8 +56,16 @@ #ifdef SERIAL_PORT_2 #if SERIAL_PORT_2 == SERIAL_PORT #error "SERIAL_PORT_2 must be different from SERIAL_PORT. Please update your configuration." - #elif WITHIN(SERIAL_PORT_2, -1, 3) + #elif SERIAL_PORT_2 == -1 || ENABLED(EMERGENCY_PARSER) #define MYSERIAL1 customizedSerial2 + #elif SERIAL_PORT_2 == 0 + #define MYSERIAL1 Serial + #elif SERIAL_PORT_2 == 1 + #define MYSERIAL1 Serial1 + #elif SERIAL_PORT_2 == 2 + #define MYSERIAL1 Serial2 + #elif SERIAL_PORT_2 == 3 + #define MYSERIAL1 Serial3 #else #error "SERIAL_PORT_2 must be from -1 to 3. Please update your configuration." #endif