From ad1b69f41786a8d3d49640cc2b215efc48a87e23 Mon Sep 17 00:00:00 2001
From: ellensp <530024+ellensp@users.noreply.github.com>
Date: Wed, 12 Apr 2023 21:07:20 +1200
Subject: [PATCH 1/5] move and update Sovol V131
---
Marlin/src/pins/gd32f1/pins_SOVOL_V131.h | 74 +++++++
Marlin/src/pins/stm32f1/pins_SOVOL_V131.h | 236 ----------------------
2 files changed, 74 insertions(+), 236 deletions(-)
create mode 100644 Marlin/src/pins/gd32f1/pins_SOVOL_V131.h
delete mode 100644 Marlin/src/pins/stm32f1/pins_SOVOL_V131.h
diff --git a/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h b/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h
new file mode 100644
index 000000000000..2b57a2e442f6
--- /dev/null
+++ b/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h
@@ -0,0 +1,74 @@
+/**
+ * Marlin 3D Printer Firmware
+ * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
+ *
+ * Based on Sprinter and grbl.
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#pragma once
+
+/**
+ * Sovol 1.3.1 (GD32F103RET6) board pin assignments
+ */
+
+#include "env_validate.h"
+
+#if HOTENDS > 1 || E_STEPPERS > 1
+ #error "SOVOL V131 only supports 1 hotend / E-stepper."
+#endif
+
+#ifndef BOARD_INFO_NAME
+ #define BOARD_INFO_NAME "Sovol V131"
+#endif
+#ifndef DEFAULT_MACHINE_NAME
+ #define DEFAULT_MACHINE_NAME "Sovol SV06"
+#endif
+
+
+#include "../stm32f1/pins_CREALITY_V4.h"
+
+#if HAS_TMC_UART
+
+ /**
+ * TMC2208/TMC2209 stepper drivers
+ *
+ * Hardware serial communication ports.
+ * If undefined software serial is used according to the pins below
+ */
+
+ #define X_SERIAL_TX_PIN PC1
+ #define X_SERIAL_RX_PIN PC1
+
+ #define Y_SERIAL_TX_PIN PC0
+ #define Y_SERIAL_RX_PIN PC0
+
+ #define Z_SERIAL_TX_PIN PA15
+ #define Z_SERIAL_RX_PIN PA15
+
+ #define E0_SERIAL_TX_PIN PC14
+ #define E0_SERIAL_RX_PIN PC14
+
+ // Reduce baud rate to improve software serial reliability
+ #define TMC_BAUD_RATE 19200
+
+#endif // HAS_TMC_UART
+
+//
+// SD Card
+//
+#define ONBOARD_SPI_DEVICE 1
+#define ONBOARD_SD_CS_PIN PA4 // SDSS
diff --git a/Marlin/src/pins/stm32f1/pins_SOVOL_V131.h b/Marlin/src/pins/stm32f1/pins_SOVOL_V131.h
deleted file mode 100644
index 97ba7f7fec83..000000000000
--- a/Marlin/src/pins/stm32f1/pins_SOVOL_V131.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/**
- * Marlin 3D Printer Firmware
- * Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
- *
- * Based on Sprinter and grbl.
- * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-#pragma once
-
-/**
- * Sovol 1.3.1 (GD32F103RET6) board pin assignments
- */
-
-#include "env_validate.h"
-
-#if HOTENDS > 1 || E_STEPPERS > 1
- #error "SOVOL V131 only supports 1 hotend / E-stepper."
-#endif
-
-#ifndef BOARD_INFO_NAME
- #define BOARD_INFO_NAME "Sovol V131"
-#endif
-#ifndef DEFAULT_MACHINE_NAME
- #define DEFAULT_MACHINE_NAME "Sovol SV06"
-#endif
-
-//#define BOARD_NO_NATIVE_USB
-
-//
-// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
-//
-#ifndef DISABLE_DEBUG
- #define DISABLE_DEBUG
-#endif
-
-//
-// EEPROM
-//
-#if NO_EEPROM_SELECTED
- #define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
- //#define SDCARD_EEPROM_EMULATION
- #undef NO_EEPROM_SELECTED
-#endif
-
-#if ENABLED(IIC_BL24CXX_EEPROM)
- #define IIC_EEPROM_SDA PA11
- #define IIC_EEPROM_SCL PA12
- #define MARLIN_EEPROM_SIZE 0x800 // 2K (24C16)
-#elif ENABLED(SDCARD_EEPROM_EMULATION)
- #define MARLIN_EEPROM_SIZE 0x800 // 2K
-#endif
-
-//
-// Servos
-//
-#ifndef SERVO0_PIN
- #ifndef HAS_PIN_27_BOARD
- #define SERVO0_PIN PB0 // BLTouch OUT
- #else
- #define SERVO0_PIN PC6
- #endif
-#endif
-
-//
-// Limit Switches
-//
-#ifndef X_STOP_PIN
- #define X_STOP_PIN PA5
-#endif
-#ifndef Y_STOP_PIN
- #define Y_STOP_PIN PA6
-#endif
-#ifndef Z_STOP_PIN
- #define Z_STOP_PIN PA7
-#endif
-
-#ifndef Z_MIN_PROBE_PIN
- #define Z_MIN_PROBE_PIN PB1 // BLTouch IN
-#endif
-
-//
-// Filament Runout Sensor
-//
-#ifndef FIL_RUNOUT_PIN
- #define FIL_RUNOUT_PIN PA4 // "Pulled-high"
-#endif
-
-//
-// Steppers
-//
-#ifndef X_STEP_PIN
- #define X_STEP_PIN PC2
-#endif
-#ifndef X_DIR_PIN
- #define X_DIR_PIN PB9
-#endif
-#define X_ENABLE_PIN PC3 // Shared
-
-#ifndef Y_STEP_PIN
- #define Y_STEP_PIN PB8
-#endif
-#ifndef Y_DIR_PIN
- #define Y_DIR_PIN PB7
-#endif
-#define Y_ENABLE_PIN X_ENABLE_PIN
-
-#ifndef Z_STEP_PIN
- #define Z_STEP_PIN PB6
-#endif
-#ifndef Z_DIR_PIN
- #define Z_DIR_PIN PB5
-#endif
-#define Z_ENABLE_PIN X_ENABLE_PIN
-
-#ifndef E0_STEP_PIN
- #define E0_STEP_PIN PB4
-#endif
-#ifndef E0_DIR_PIN
- #define E0_DIR_PIN PB3
-#endif
-#define E0_ENABLE_PIN X_ENABLE_PIN
-
-#if HAS_TMC_UART
-
- /**
- * TMC2208/TMC2209 stepper drivers
- *
- * Hardware serial communication ports.
- * If undefined software serial is used according to the pins below
- */
-
- #define X_SERIAL_TX_PIN PC1
- #define X_SERIAL_RX_PIN PC1
-
- #define Y_SERIAL_TX_PIN PC0
- #define Y_SERIAL_RX_PIN PC0
-
- #define Z_SERIAL_TX_PIN PA15
- #define Z_SERIAL_RX_PIN PA15
-
- #define E0_SERIAL_TX_PIN PC14
- #define E0_SERIAL_RX_PIN PC14
-
- // Reduce baud rate to improve software serial reliability
- #define TMC_BAUD_RATE 19200
-
-#endif // HAS_TMC_UART
-
-//
-// Temperature Sensors
-//
-#define TEMP_0_PIN PC5 // TH1
-#define TEMP_BED_PIN PC4 // TB1
-
-//
-// Heaters / Fans
-//
-#ifndef HEATER_0_PIN
- #define HEATER_0_PIN PA1 // HEATER1
-#endif
-#ifndef HEATER_BED_PIN
- #define HEATER_BED_PIN PA2 // HOT BED
-#endif
-#ifndef FAN0_PIN
- #define FAN0_PIN PA0 // FAN
-#endif
-#define FAN_SOFT_PWM_REQUIRED
-
-//
-// SD Card
-//
-#define SD_DETECT_PIN PC7
-#define SDCARD_CONNECTION ONBOARD
-#define ONBOARD_SPI_DEVICE 1
-#define ONBOARD_SD_CS_PIN PA4 // SDSS
-#define SDIO_SUPPORT
-#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer
-
-#if ANY(RET6_12864_LCD, HAS_DWIN_E3V2, IS_DWIN_MARLINUI)
- /**
- * RET6 12864 LCD
- * ------
- * PC6 | 1 2 | PB2
- * PB10 | 3 4 | PB11
- * PB14 5 6 | PB13
- * PB12 | 7 8 | PB15
- * GND | 9 10 | 5V
- * ------
- */
- #define EXP3_01_PIN PC6
- #define EXP3_02_PIN PB2
- #define EXP3_03_PIN PB10
- #define EXP3_04_PIN PB11
- #define EXP3_05_PIN PB14
- #define EXP3_06_PIN PB13
- #define EXP3_07_PIN PB12
- #define EXP3_08_PIN PB15
-#endif
-
-#if ENABLED(CR10_STOCKDISPLAY)
-
- #if ENABLED(RET6_12864_LCD)
-
- #define LCD_PINS_RS EXP3_07_PIN
- #define LCD_PINS_EN EXP3_08_PIN
- #define LCD_PINS_D4 EXP3_06_PIN
-
- #define BTN_ENC EXP3_02_PIN
- #define BTN_EN1 EXP3_03_PIN
- #define BTN_EN2 EXP3_05_PIN
-
- #ifndef HAS_PIN_27_BOARD
- #define BEEPER_PIN EXP3_01_PIN
- #endif
-
- #else
-
- #error "Only the RET6_12864_LCD variant of CR10_STOCKDISPLAY is supported."
-
- #endif
-
-#endif
From a7635a664aee57f5a549aabba2b4522300d8b15b Mon Sep 17 00:00:00 2001
From: ellensp <530024+ellensp@users.noreply.github.com>
Date: Wed, 12 Apr 2023 21:09:49 +1200
Subject: [PATCH 2/5] update pins.h with new path
---
Marlin/src/pins/pins.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h
index 124c940422c8..5cb085f88dc5 100644
--- a/Marlin/src/pins/pins.h
+++ b/Marlin/src/pins/pins.h
@@ -628,7 +628,7 @@
#elif MB(PANDA_PI_V29)
#include "stm32f1/pins_PANDA_PI_V29.h" // STM32F103RCT6 env:PANDA_PI_V29
#elif MB(SOVOL_V131)
- #include "stm32f1/pins_SOVOL_V131.h" // GD32F1 env:GD32F103RET6_sovol_maple
+ #include "gd32f1/pins_SOVOL_V131.h" // GD32F1 env:GD32F103RET6_sovol_maple
#elif MB(TRIGORILLA_V006)
#include "gd32f1/pins_TRIGORILLA_V006.h" // GD32F103 env:trigorilla_v006
From 8530feec39c06bd319b99c6601a11854fecf3b89 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sun, 23 Apr 2023 05:56:51 -0500
Subject: [PATCH 3/5] validate just once
---
Marlin/src/pins/esp32/env_validate.h | 5 ++++-
Marlin/src/pins/gd32f1/env_validate.h | 11 ++++-------
Marlin/src/pins/lpc1768/env_validate.h | 5 ++++-
Marlin/src/pins/lpc1769/env_validate.h | 5 ++++-
Marlin/src/pins/mega/env_validate.h | 5 ++++-
Marlin/src/pins/rambo/env_validate.h | 5 ++++-
Marlin/src/pins/ramps/env_validate.h | 5 ++++-
Marlin/src/pins/sam/env_validate.h | 5 ++++-
Marlin/src/pins/sanguino/env_validate.h | 5 ++++-
Marlin/src/pins/stm32f1/env_validate.h | 5 ++++-
Marlin/src/pins/stm32f4/env_validate.h | 5 ++++-
Marlin/src/pins/stm32g0/env_validate.h | 5 ++++-
Marlin/src/pins/stm32h7/env_validate.h | 5 ++++-
Marlin/src/pins/teensy2/env_validate.h | 5 ++++-
14 files changed, 56 insertions(+), 20 deletions(-)
diff --git a/Marlin/src/pins/esp32/env_validate.h b/Marlin/src/pins/esp32/env_validate.h
index ce14c33414ad..0bfd0ebd92be 100644
--- a/Marlin/src/pins/esp32/env_validate.h
+++ b/Marlin/src/pins/esp32/env_validate.h
@@ -19,8 +19,11 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(ARDUINO_ARCH_ESP32)
#error "Oops! Select an ESP32 board in 'Tools > Board.'"
#endif
+
+#endif
diff --git a/Marlin/src/pins/gd32f1/env_validate.h b/Marlin/src/pins/gd32f1/env_validate.h
index 4b07cce4e5c4..f6882e70d633 100644
--- a/Marlin/src/pins/gd32f1/env_validate.h
+++ b/Marlin/src/pins/gd32f1/env_validate.h
@@ -19,14 +19,11 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(__STM32F1__, STM32F1)
- #if DISABLED(ALLOW_STM32F4)
- #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
- #elif NOT_TARGET(STM32F4)
- #error "Oops! Select an STM32F4 board in 'Tools > Board.'"
- #endif
+ #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
#endif
-#undef ALLOW_STM32F4
+#endif
diff --git a/Marlin/src/pins/lpc1768/env_validate.h b/Marlin/src/pins/lpc1768/env_validate.h
index adb3ea938dc2..8a6a1cebd368 100644
--- a/Marlin/src/pins/lpc1768/env_validate.h
+++ b/Marlin/src/pins/lpc1768/env_validate.h
@@ -19,7 +19,8 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if ENABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
@@ -28,3 +29,5 @@
#endif
#undef REQUIRE_LPC1769
+
+#endif
diff --git a/Marlin/src/pins/lpc1769/env_validate.h b/Marlin/src/pins/lpc1769/env_validate.h
index 2e2b63d5203f..0f62412453a4 100644
--- a/Marlin/src/pins/lpc1769/env_validate.h
+++ b/Marlin/src/pins/lpc1769/env_validate.h
@@ -19,8 +19,11 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
+
+#endif
diff --git a/Marlin/src/pins/mega/env_validate.h b/Marlin/src/pins/mega/env_validate.h
index 97c52d4e5e05..7b6462ab7a97 100644
--- a/Marlin/src/pins/mega/env_validate.h
+++ b/Marlin/src/pins/mega/env_validate.h
@@ -19,7 +19,8 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(__AVR_ATmega2560__)
#if DISABLED(ALLOW_MEGA1280)
@@ -30,3 +31,5 @@
#endif
#undef ALLOW_MEGA1280
+
+#endif
diff --git a/Marlin/src/pins/rambo/env_validate.h b/Marlin/src/pins/rambo/env_validate.h
index 84cf8392cdfc..ce2818f596d3 100644
--- a/Marlin/src/pins/rambo/env_validate.h
+++ b/Marlin/src/pins/rambo/env_validate.h
@@ -19,8 +19,11 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(__AVR_ATmega2560__)
#error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'"
#endif
+
+#endif
diff --git a/Marlin/src/pins/ramps/env_validate.h b/Marlin/src/pins/ramps/env_validate.h
index 6006a78f013c..86d7bce16c16 100644
--- a/Marlin/src/pins/ramps/env_validate.h
+++ b/Marlin/src/pins/ramps/env_validate.h
@@ -19,7 +19,8 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if ENABLED(ALLOW_SAM3X8E)
#if NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
@@ -33,3 +34,5 @@
#undef ALLOW_SAM3X8E
#undef REQUIRE_MEGA2560
+
+#endif
diff --git a/Marlin/src/pins/sam/env_validate.h b/Marlin/src/pins/sam/env_validate.h
index 09bcd1364921..c6f4d76894be 100644
--- a/Marlin/src/pins/sam/env_validate.h
+++ b/Marlin/src/pins/sam/env_validate.h
@@ -19,7 +19,8 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if BOTH(ALLOW_MEGA1280, ALLOW_MEGA2560) && NOT_TARGET(__SAM3X8E__, __AVR_ATmega1280__, __AVR_ATmega2560__)
#error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'"
@@ -31,3 +32,5 @@
#undef ALLOW_MEGA1280
#undef ALLOW_MEGA2560
+
+#endif
diff --git a/Marlin/src/pins/sanguino/env_validate.h b/Marlin/src/pins/sanguino/env_validate.h
index d229b6f102e4..bd7947f469a5 100644
--- a/Marlin/src/pins/sanguino/env_validate.h
+++ b/Marlin/src/pins/sanguino/env_validate.h
@@ -19,7 +19,8 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if ENABLED(ALLOW_MEGA644)
#if NOT_TARGET(__AVR_ATmega644__, __AVR_ATmega644P__, __AVR_ATmega1284P__)
@@ -40,3 +41,5 @@
#undef ALLOW_MEGA644
#undef ALLOW_MEGA644P
#undef REQUIRE_MEGA644P
+
+#endif
diff --git a/Marlin/src/pins/stm32f1/env_validate.h b/Marlin/src/pins/stm32f1/env_validate.h
index 2d325428ac8c..47399a062d6c 100644
--- a/Marlin/src/pins/stm32f1/env_validate.h
+++ b/Marlin/src/pins/stm32f1/env_validate.h
@@ -19,7 +19,8 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(__STM32F1__, STM32F1)
#if DISABLED(ALLOW_STM32F4)
@@ -30,3 +31,5 @@
#endif
#undef ALLOW_STM32F4
+
+#endif
diff --git a/Marlin/src/pins/stm32f4/env_validate.h b/Marlin/src/pins/stm32f4/env_validate.h
index c01401f06c9a..91adbfc86929 100644
--- a/Marlin/src/pins/stm32f4/env_validate.h
+++ b/Marlin/src/pins/stm32f4/env_validate.h
@@ -19,10 +19,13 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(STM32F4) && (DISABLED(ALLOW_STM32DUINO) || NOT_TARGET(STM32F4xx))
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
#endif
#undef ALLOW_STM32DUINO
+
+#endif
diff --git a/Marlin/src/pins/stm32g0/env_validate.h b/Marlin/src/pins/stm32g0/env_validate.h
index a7be76bd8bb1..03887eb7a491 100644
--- a/Marlin/src/pins/stm32g0/env_validate.h
+++ b/Marlin/src/pins/stm32g0/env_validate.h
@@ -19,8 +19,11 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(STM32G0xx) || NOT_TARGET(STM32G0B1xx)
#error "Oops! Select an STM32G0 board in 'Tools > Board.'"
#endif
+
+#endif
diff --git a/Marlin/src/pins/stm32h7/env_validate.h b/Marlin/src/pins/stm32h7/env_validate.h
index 0c515e5df6be..7feaf2095909 100644
--- a/Marlin/src/pins/stm32h7/env_validate.h
+++ b/Marlin/src/pins/stm32h7/env_validate.h
@@ -19,8 +19,11 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(STM32H7)
#error "Oops! Select an STM32H7 board in 'Tools > Board.'"
#endif
+
+#endif
diff --git a/Marlin/src/pins/teensy2/env_validate.h b/Marlin/src/pins/teensy2/env_validate.h
index 5f0ea4f3b672..8fd6fba31932 100644
--- a/Marlin/src/pins/teensy2/env_validate.h
+++ b/Marlin/src/pins/teensy2/env_validate.h
@@ -19,10 +19,13 @@
* along with this program. If not, see .
*
*/
-#pragma once
+#ifndef ENV_VALIDATE_H
+#define ENV_VALIDATE_H
#if NOT_TARGET(__AVR_AT90USB1286__) && (DISABLED(ALLOW_AT90USB1286P) || NOT_TARGET(__AVR_AT90USB1286P__))
#error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'"
#endif
#undef ALLOW_AT90USB1286P
+
+#endif
From cdb827d1d65490c07196e4141003626cfbad61e1 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sun, 23 Apr 2023 05:59:50 -0500
Subject: [PATCH 4/5] prevent confusing double #error
---
Marlin/src/pins/gd32f1/pins_SOVOL_V131.h | 4 ++--
Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h | 5 +++++
Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h | 1 +
Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 2 +-
Marlin/src/pins/stm32f1/pins_CREALITY_V425.h | 4 ----
5 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h b/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h
index 2b57a2e442f6..44e527542362 100644
--- a/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h
+++ b/Marlin/src/pins/gd32f1/pins_SOVOL_V131.h
@@ -27,8 +27,9 @@
#include "env_validate.h"
-#if HOTENDS > 1 || E_STEPPERS > 1
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "SOVOL V131 only supports 1 hotend / E-stepper."
+ #define E_ERROR 1
#endif
#ifndef BOARD_INFO_NAME
@@ -38,7 +39,6 @@
#define DEFAULT_MACHINE_NAME "Sovol SV06"
#endif
-
#include "../stm32f1/pins_CREALITY_V4.h"
#if HAS_TMC_UART
diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h
index f7a73de28471..058dcdf94f23 100644
--- a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h
+++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h
@@ -25,6 +25,11 @@
* Creality v2.4.S1 (STM32F103RE / STM32F103RC) v101 as found in the Ender-7
*/
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
+ #error "Creality 2.4.S1 V101 only supports 1 hotend / E stepper."
+ #define E_ERROR 1
+#endif
+
#define BOARD_INFO_NAME "Creality v2.4.S1 V101"
#define DEFAULT_MACHINE_NAME "Creality3D"
diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h
index 4276db5e9f22..f2450ffcb4e7 100644
--- a/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h
+++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h
@@ -30,6 +30,7 @@
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "Creality v24S1 only supports 1 hotend / E stepper."
+ #define E_ERROR 1
#endif
#if BOTH(BLTOUCH, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)
diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
index fd96799372c7..6cb4d48d58c1 100644
--- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
+++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
@@ -27,7 +27,7 @@
#include "env_validate.h"
-#if HAS_MULTI_HOTEND || E_STEPPERS > 1
+#if !E_ERROR && (HAS_MULTI_HOTEND || E_STEPPERS > 1)
#error "Creality v4 only supports 1 hotend / E stepper."
#endif
diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V425.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V425.h
index 2d9b9f38f54f..a225fe11be5a 100644
--- a/Marlin/src/pins/stm32f1/pins_CREALITY_V425.h
+++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V425.h
@@ -27,10 +27,6 @@
#include "env_validate.h"
-#if HAS_MULTI_HOTEND || E_STEPPERS > 1
- #error "Creality v4.2.5 only supports 1 hotend / E stepper."
-#endif
-
#define BOARD_INFO_NAME "Creality V4.2.5"
#define DEFAULT_MACHINE_NAME "CR200B"
From 20179273ae5fa1eb1b9626e4d444d38ce07e3a22 Mon Sep 17 00:00:00 2001
From: Scott Lahteine
Date: Sun, 23 Apr 2023 06:00:15 -0500
Subject: [PATCH 5/5] clean up some #errors
---
Marlin/src/pins/esp32/pins_E4D.h | 4 +---
Marlin/src/pins/esp32/pins_FYSETC_E4.h | 4 +---
Marlin/src/pins/esp32/pins_MRR_ESPA.h | 4 +---
Marlin/src/pins/esp32/pins_PANDA_M4.h | 4 ++++
Marlin/src/pins/esp32/pins_PANDA_ZHU.h | 6 ++++++
Marlin/src/pins/mega/pins_GT2560_V3.h | 4 ++++
Marlin/src/pins/mega/pins_PICA.h | 4 ++++
Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h | 2 +-
Marlin/src/pins/stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h | 2 +-
Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h | 2 +-
10 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/Marlin/src/pins/esp32/pins_E4D.h b/Marlin/src/pins/esp32/pins_E4D.h
index 15b697a85b2c..06e46e3c4c08 100644
--- a/Marlin/src/pins/esp32/pins_E4D.h
+++ b/Marlin/src/pins/esp32/pins_E4D.h
@@ -30,9 +30,7 @@
#include "env_validate.h"
-#if EXTRUDERS > 1 || E_STEPPERS > 1
- #error "E4d@box only supports 1 E stepper."
-#elif HAS_MULTI_HOTEND
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "E4d@box only supports 1 hotend / E stepper."
#endif
diff --git a/Marlin/src/pins/esp32/pins_FYSETC_E4.h b/Marlin/src/pins/esp32/pins_FYSETC_E4.h
index 7dc59979c8f1..4bcffb545ee0 100644
--- a/Marlin/src/pins/esp32/pins_FYSETC_E4.h
+++ b/Marlin/src/pins/esp32/pins_FYSETC_E4.h
@@ -30,9 +30,7 @@
#include "env_validate.h"
-#if EXTRUDERS > 1 || E_STEPPERS > 1
- #error "FYSETC E4 only supports 1 E stepper."
-#elif HAS_MULTI_HOTEND
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "FYSETC E4 only supports 1 hotend / E stepper."
#endif
diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPA.h b/Marlin/src/pins/esp32/pins_MRR_ESPA.h
index e9e3db575896..ba5f6cbe35fa 100644
--- a/Marlin/src/pins/esp32/pins_MRR_ESPA.h
+++ b/Marlin/src/pins/esp32/pins_MRR_ESPA.h
@@ -30,9 +30,7 @@
#include "env_validate.h"
-#if EXTRUDERS > 1 || E_STEPPERS > 1
- #error "MRR ESPA only supports 1 E stepper."
-#elif HAS_MULTI_HOTEND
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "MRR ESPA only supports 1 hotend / E stepper."
#endif
diff --git a/Marlin/src/pins/esp32/pins_PANDA_M4.h b/Marlin/src/pins/esp32/pins_PANDA_M4.h
index 5e2e72af05df..c619be43a5f8 100644
--- a/Marlin/src/pins/esp32/pins_PANDA_M4.h
+++ b/Marlin/src/pins/esp32/pins_PANDA_M4.h
@@ -27,6 +27,10 @@
#define BOARD_INFO_NAME "Panda_M4"
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
+ #error "PANDA M4 only supports 1 hotend / E stepper."
+#endif
+
#include "pins_PANDA_common.h"
//
diff --git a/Marlin/src/pins/esp32/pins_PANDA_ZHU.h b/Marlin/src/pins/esp32/pins_PANDA_ZHU.h
index 47500578976e..f2a5f440f674 100644
--- a/Marlin/src/pins/esp32/pins_PANDA_ZHU.h
+++ b/Marlin/src/pins/esp32/pins_PANDA_ZHU.h
@@ -27,6 +27,12 @@
#define BOARD_INFO_NAME "Panda_ZHU"
+#if E_STEPPERS > 5
+ #error "PANDA ZHU supports up to 5 E steppers."
+#if HAS_MULTI_HOTEND
+ #error "PANDA ZHU only supports 1 hotend."
+#endif
+
#include "pins_PANDA_common.h"
//
diff --git a/Marlin/src/pins/mega/pins_GT2560_V3.h b/Marlin/src/pins/mega/pins_GT2560_V3.h
index b04962bbb357..61f30fc7d4f4 100644
--- a/Marlin/src/pins/mega/pins_GT2560_V3.h
+++ b/Marlin/src/pins/mega/pins_GT2560_V3.h
@@ -33,6 +33,10 @@
#define ALLOW_MEGA1280
#include "env_validate.h"
+#if HOTENDS > 3 || E_STEPPERS > 3
+ #error "GT2560 supports up to 3 hotends / E steppers."
+#endif
+
#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "GT2560 3.x"
#endif
diff --git a/Marlin/src/pins/mega/pins_PICA.h b/Marlin/src/pins/mega/pins_PICA.h
index 0541e1af58bf..5e9d607a7864 100644
--- a/Marlin/src/pins/mega/pins_PICA.h
+++ b/Marlin/src/pins/mega/pins_PICA.h
@@ -35,6 +35,10 @@
#include "env_validate.h"
+#if HOTENDS > 2 || E_STEPPERS > 2
+ #error "PICA supports up to 2 hotends / E steppers."
+#endif
+
#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "PICA"
#endif
diff --git a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h
index 7b0206e2878f..8510e8148259 100644
--- a/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h
+++ b/Marlin/src/pins/stm32f4/pins_ARTILLERY_RUBY.h
@@ -23,7 +23,7 @@
#include "env_validate.h"
-#if HOTENDS > 1 || E_STEPPERS > 1
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "Artillery Ruby only supports 1 hotend / E stepper."
#endif
diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h
index ffddeff67c0f..6f2de83b5142 100644
--- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h
+++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h
@@ -25,7 +25,7 @@
#include "env_validate.h"
-#if HOTENDS > 1 || E_STEPPERS > 1
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "BTT SKR Mini E3 V3.0.1 supports up to 1 hotend / E stepper."
#endif
diff --git a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h
index 448c54f1b3e4..b74db89f3a0c 100644
--- a/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h
+++ b/Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h
@@ -24,7 +24,7 @@
#define ALLOW_STM32DUINO
#include "env_validate.h"
-#if HOTENDS > 1 || E_STEPPERS > 1
+#if HAS_MULTI_HOTEND || E_STEPPERS > 1
#error "TH3D EZBoard only supports 1 hotend / E stepper."
#endif