From 1ad036c52f1faa3670ee16f77eb036002ff3f8a0 Mon Sep 17 00:00:00 2001
From: ellensp <530024+ellensp@users.noreply.github.com>
Date: Mon, 1 Aug 2022 18:17:57 +1200
Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Update=20644p/1284p=20Serial=201?=
 =?UTF-8?q?=20sanity=20check=20(#24575)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Marlin/src/HAL/AVR/inc/SanityCheck.h | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Marlin/src/HAL/AVR/inc/SanityCheck.h b/Marlin/src/HAL/AVR/inc/SanityCheck.h
index 1c1d8d44135..89425ca853b 100644
--- a/Marlin/src/HAL/AVR/inc/SanityCheck.h
+++ b/Marlin/src/HAL/AVR/inc/SanityCheck.h
@@ -35,11 +35,19 @@
   || X_STEP_PIN == N || Y_STEP_PIN == N || Z_STEP_PIN == N \
   || X_DIR_PIN  == N || Y_DIR_PIN  == N || Z_DIR_PIN  == N \
   || X_ENA_PIN  == N || Y_ENA_PIN  == N || Z_ENA_PIN  == N \
+  || BTN_EN1    == N || BTN_EN2    == N \
 )
-#if CONF_SERIAL_IS(0) // D0-D1. No known conflicts.
+#if CONF_SERIAL_IS(0)
+  // D0-D1. No known conflicts.
 #endif
-#if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
-  #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
+#if NOT_TARGET(__AVR_ATmega644P__, __AVR_ATmega1284P__)
+  #if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(18) || CHECK_SERIAL_PIN(19))
+    #error "Serial Port 1 pin D18 and/or D19 conflicts with another pin on the board."
+  #endif
+#else
+  #if CONF_SERIAL_IS(1) && (CHECK_SERIAL_PIN(10) || CHECK_SERIAL_PIN(11))
+    #error "Serial Port 1 pin D10 and/or D11 conflicts with another pin on the board."
+  #endif
 #endif
 #if CONF_SERIAL_IS(2) && (CHECK_SERIAL_PIN(16) || CHECK_SERIAL_PIN(17))
   #error "Serial Port 2 pin D16 and/or D17 conflicts with another pin on the board."