Skip to content

Commit 9902097

Browse files
ellenspthinkyhead
andauthored
🔨 Gather GD32, suppress redundant #error (MarlinFirmware#25665)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
1 parent 10ed5ab commit 9902097

31 files changed

+162
-274
lines changed

Marlin/src/pins/esp32/env_validate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if NOT_TARGET(ARDUINO_ARCH_ESP32)
2526
#error "Oops! Select an ESP32 board in 'Tools > Board.'"
2627
#endif
28+
29+
#endif

Marlin/src/pins/esp32/pins_E4D.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030

3131
#include "env_validate.h"
3232

33-
#if EXTRUDERS > 1 || E_STEPPERS > 1
34-
#error "E4d@box only supports 1 E stepper."
35-
#elif HAS_MULTI_HOTEND
33+
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
3634
#error "E4d@box only supports 1 hotend / E stepper."
3735
#endif
3836

Marlin/src/pins/esp32/pins_FYSETC_E4.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030

3131
#include "env_validate.h"
3232

33-
#if EXTRUDERS > 1 || E_STEPPERS > 1
34-
#error "FYSETC E4 only supports 1 E stepper."
35-
#elif HAS_MULTI_HOTEND
33+
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
3634
#error "FYSETC E4 only supports 1 hotend / E stepper."
3735
#endif
3836

Marlin/src/pins/esp32/pins_MRR_ESPA.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030

3131
#include "env_validate.h"
3232

33-
#if EXTRUDERS > 1 || E_STEPPERS > 1
34-
#error "MRR ESPA only supports 1 E stepper."
35-
#elif HAS_MULTI_HOTEND
33+
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
3634
#error "MRR ESPA only supports 1 hotend / E stepper."
3735
#endif
3836

Marlin/src/pins/esp32/pins_PANDA_M4.h

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727

2828
#define BOARD_INFO_NAME "Panda_M4"
2929

30+
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
31+
#error "PANDA M4 only supports 1 hotend / E stepper."
32+
#endif
33+
3034
#include "pins_PANDA_common.h"
3135

3236
//

Marlin/src/pins/esp32/pins_PANDA_ZHU.h

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727

2828
#define BOARD_INFO_NAME "Panda_ZHU"
2929

30+
#if E_STEPPERS > 5
31+
#error "PANDA ZHU supports up to 5 E steppers."
32+
#if HAS_MULTI_HOTEND
33+
#error "PANDA ZHU only supports 1 hotend."
34+
#endif
35+
3036
#include "pins_PANDA_common.h"
3137

3238
//

Marlin/src/pins/gd32f1/env_validate.h

+4-7
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,11 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if NOT_TARGET(__STM32F1__, STM32F1)
25-
#if DISABLED(ALLOW_STM32F4)
26-
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
27-
#elif NOT_TARGET(STM32F4)
28-
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
29-
#endif
26+
#error "Oops! Select an STM32F1 board in 'Tools > Board.'"
3027
#endif
3128

32-
#undef ALLOW_STM32F4
29+
#endif
+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
/**
25+
* Sovol 1.3.1 (GD32F103RET6) board pin assignments
26+
*/
27+
28+
#include "env_validate.h"
29+
30+
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
31+
#error "SOVOL V131 only supports 1 hotend / E-stepper."
32+
#define E_ERROR 1
33+
#endif
34+
35+
#ifndef BOARD_INFO_NAME
36+
#define BOARD_INFO_NAME "Sovol V131"
37+
#endif
38+
#ifndef DEFAULT_MACHINE_NAME
39+
#define DEFAULT_MACHINE_NAME "Sovol SV06"
40+
#endif
41+
42+
#include "../stm32f1/pins_CREALITY_V4.h"
43+
44+
#if HAS_TMC_UART
45+
46+
/**
47+
* TMC2208/TMC2209 stepper drivers
48+
*
49+
* Hardware serial communication ports.
50+
* If undefined software serial is used according to the pins below
51+
*/
52+
53+
#define X_SERIAL_TX_PIN PC1
54+
#define X_SERIAL_RX_PIN PC1
55+
56+
#define Y_SERIAL_TX_PIN PC0
57+
#define Y_SERIAL_RX_PIN PC0
58+
59+
#define Z_SERIAL_TX_PIN PA15
60+
#define Z_SERIAL_RX_PIN PA15
61+
62+
#define E0_SERIAL_TX_PIN PC14
63+
#define E0_SERIAL_RX_PIN PC14
64+
65+
// Reduce baud rate to improve software serial reliability
66+
#define TMC_BAUD_RATE 19200
67+
68+
#endif // HAS_TMC_UART
69+
70+
//
71+
// SD Card
72+
//
73+
#define ONBOARD_SPI_DEVICE 1
74+
#define ONBOARD_SD_CS_PIN PA4 // SDSS

Marlin/src/pins/lpc1768/env_validate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if ENABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1769)
2526
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
@@ -28,3 +29,5 @@
2829
#endif
2930

3031
#undef REQUIRE_LPC1769
32+
33+
#endif

Marlin/src/pins/lpc1769/env_validate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if NOT_TARGET(MCU_LPC1769)
2526
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
2627
#endif
28+
29+
#endif

Marlin/src/pins/mega/env_validate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if NOT_TARGET(__AVR_ATmega2560__)
2526
#if DISABLED(ALLOW_MEGA1280)
@@ -30,3 +31,5 @@
3031
#endif
3132

3233
#undef ALLOW_MEGA1280
34+
35+
#endif

Marlin/src/pins/mega/pins_GT2560_V3.h

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
#define ALLOW_MEGA1280
3434
#include "env_validate.h"
3535

36+
#if HOTENDS > 3 || E_STEPPERS > 3
37+
#error "GT2560 supports up to 3 hotends / E steppers."
38+
#endif
39+
3640
#ifndef BOARD_INFO_NAME
3741
#define BOARD_INFO_NAME "GT2560 3.x"
3842
#endif

Marlin/src/pins/mega/pins_PICA.h

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535

3636
#include "env_validate.h"
3737

38+
#if HOTENDS > 2 || E_STEPPERS > 2
39+
#error "PICA supports up to 2 hotends / E steppers."
40+
#endif
41+
3842
#ifndef BOARD_INFO_NAME
3943
#define BOARD_INFO_NAME "PICA"
4044
#endif

Marlin/src/pins/pins.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@
632632
#elif MB(PANDA_PI_V29)
633633
#include "stm32f1/pins_PANDA_PI_V29.h" // STM32F103RCT6 env:PANDA_PI_V29
634634
#elif MB(SOVOL_V131)
635-
#include "stm32f1/pins_SOVOL_V131.h" // GD32F1 env:GD32F103RET6_sovol_maple
635+
#include "gd32f1/pins_SOVOL_V131.h" // GD32F1 env:GD32F103RET6_sovol_maple
636636
#elif MB(TRIGORILLA_V006)
637637
#include "gd32f1/pins_TRIGORILLA_V006.h" // GD32F103 env:trigorilla_v006
638638

Marlin/src/pins/rambo/env_validate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if NOT_TARGET(__AVR_ATmega2560__)
2526
#error "Oops! Select 'Arduino Mega 2560 or Rambo' in 'Tools > Board.'"
2627
#endif
28+
29+
#endif

Marlin/src/pins/ramps/env_validate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if ENABLED(ALLOW_SAM3X8E)
2526
#if NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
@@ -33,3 +34,5 @@
3334

3435
#undef ALLOW_SAM3X8E
3536
#undef REQUIRE_MEGA2560
37+
38+
#endif

Marlin/src/pins/sam/env_validate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if BOTH(ALLOW_MEGA1280, ALLOW_MEGA2560) && NOT_TARGET(__SAM3X8E__, __AVR_ATmega1280__, __AVR_ATmega2560__)
2526
#error "Oops! Select 'Arduino Due or Mega' in 'Tools > Board.'"
@@ -31,3 +32,5 @@
3132

3233
#undef ALLOW_MEGA1280
3334
#undef ALLOW_MEGA2560
35+
36+
#endif

Marlin/src/pins/sanguino/env_validate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if ENABLED(ALLOW_MEGA644)
2526
#if NOT_TARGET(__AVR_ATmega644__, __AVR_ATmega644P__, __AVR_ATmega1284P__)
@@ -40,3 +41,5 @@
4041
#undef ALLOW_MEGA644
4142
#undef ALLOW_MEGA644P
4243
#undef REQUIRE_MEGA644P
44+
45+
#endif

Marlin/src/pins/stm32f1/env_validate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
*
2121
*/
22-
#pragma once
22+
#ifndef ENV_VALIDATE_H
23+
#define ENV_VALIDATE_H
2324

2425
#if NOT_TARGET(__STM32F1__, STM32F1)
2526
#if DISABLED(ALLOW_STM32F4)
@@ -30,3 +31,5 @@
3031
#endif
3132

3233
#undef ALLOW_STM32F4
34+
35+
#endif

Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
* Creality v2.4.S1 (STM32F103RE / STM32F103RC) v101 as found in the Ender-7
2626
*/
2727

28+
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
29+
#error "Creality 2.4.S1 V101 only supports 1 hotend / E stepper."
30+
#define E_ERROR 1
31+
#endif
32+
2833
#define BOARD_INFO_NAME "Creality v2.4.S1 V101"
2934
#define DEFAULT_MACHINE_NAME "Creality3D"
3035

Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
3232
#error "Creality v24S1 only supports 1 hotend / E stepper."
33+
#define E_ERROR 1
3334
#endif
3435

3536
#if BOTH(BLTOUCH, Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN)

Marlin/src/pins/stm32f1/pins_CREALITY_V4.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include "env_validate.h"
2929

30-
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
30+
#if !E_ERROR && (HAS_MULTI_HOTEND || E_STEPPERS > 1)
3131
#error "Creality v4 only supports 1 hotend / E stepper."
3232
#endif
3333

Marlin/src/pins/stm32f1/pins_CREALITY_V425.h

-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727

2828
#include "env_validate.h"
2929

30-
#if HAS_MULTI_HOTEND || E_STEPPERS > 1
31-
#error "Creality v4.2.5 only supports 1 hotend / E stepper."
32-
#endif
33-
3430
#define BOARD_INFO_NAME "Creality V4.2.5"
3531
#define DEFAULT_MACHINE_NAME "CR200B"
3632

0 commit comments

Comments
 (0)