Skip to content

Commit

Permalink
🔨 Gather GD32, suppress redundant #error (MarlinFirmware#25665)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
2 people authored and Tracy Spiva committed May 25, 2023
1 parent c3e8471 commit e143590
Show file tree
Hide file tree
Showing 31 changed files with 162 additions and 274 deletions.
5 changes: 4 additions & 1 deletion Marlin/src/pins/esp32/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#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
4 changes: 1 addition & 3 deletions Marlin/src/pins/esp32/pins_E4D.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/esp32/pins_FYSETC_E4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/esp32/pins_MRR_ESPA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/pins/esp32/pins_PANDA_M4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

//
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/pins/esp32/pins_PANDA_ZHU.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

//
Expand Down
11 changes: 4 additions & 7 deletions Marlin/src/pins/gd32f1/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#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
74 changes: 74 additions & 0 deletions Marlin/src/pins/gd32f1/pins_SOVOL_V131.h
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*
*/
#pragma once

/**
* Sovol 1.3.1 (GD32F103RET6) board pin assignments
*/

#include "env_validate.h"

#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
#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
5 changes: 4 additions & 1 deletion Marlin/src/pins/lpc1768/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#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."
Expand All @@ -28,3 +29,5 @@
#endif

#undef REQUIRE_LPC1769

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/lpc1769/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#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
5 changes: 4 additions & 1 deletion Marlin/src/pins/mega/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(__AVR_ATmega2560__)
#if DISABLED(ALLOW_MEGA1280)
Expand All @@ -30,3 +31,5 @@
#endif

#undef ALLOW_MEGA1280

#endif
4 changes: 4 additions & 0 deletions Marlin/src/pins/mega/pins_GT2560_V3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/pins/mega/pins_PICA.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,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

Expand Down
5 changes: 4 additions & 1 deletion Marlin/src/pins/rambo/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#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
5 changes: 4 additions & 1 deletion Marlin/src/pins/ramps/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if ENABLED(ALLOW_SAM3X8E)
#if NOT_TARGET(__SAM3X8E__, __AVR_ATmega2560__)
Expand All @@ -33,3 +34,5 @@

#undef ALLOW_SAM3X8E
#undef REQUIRE_MEGA2560

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/sam/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#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.'"
Expand All @@ -31,3 +32,5 @@

#undef ALLOW_MEGA1280
#undef ALLOW_MEGA2560

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/sanguino/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if ENABLED(ALLOW_MEGA644)
#if NOT_TARGET(__AVR_ATmega644__, __AVR_ATmega644P__, __AVR_ATmega1284P__)
Expand All @@ -40,3 +41,5 @@
#undef ALLOW_MEGA644
#undef ALLOW_MEGA644P
#undef REQUIRE_MEGA644P

#endif
5 changes: 4 additions & 1 deletion Marlin/src/pins/stm32f1/env_validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#ifndef ENV_VALIDATE_H
#define ENV_VALIDATE_H

#if NOT_TARGET(__STM32F1__, STM32F1)
#if DISABLED(ALLOW_STM32F4)
Expand All @@ -30,3 +31,5 @@
#endif

#undef ALLOW_STM32F4

#endif
5 changes: 5 additions & 0 deletions Marlin/src/pins/stm32f1/pins_CREALITY_V24S1.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions Marlin/src/pins/stm32f1/pins_CREALITY_V24S1_301.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f1/pins_CREALITY_V4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions Marlin/src/pins/stm32f1/pins_CREALITY_V425.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Loading

0 comments on commit e143590

Please sign in to comment.