0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-03-13 01:40:09 +00:00

🔨 Gather GD32, suppress redundant #error (#25665)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
ellensp 2023-04-24 11:11:02 +12:00 committed by GitHub
parent 10ed5ab01c
commit 9902097d91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 162 additions and 274 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"
//

View file

@ -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"
//

View file

@ -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

View file

@ -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

View file

@ -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."
@ -28,3 +29,5 @@
#endif
#undef REQUIRE_LPC1769
#endif

View file

@ -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

View file

@ -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)
@ -30,3 +31,5 @@
#endif
#undef ALLOW_MEGA1280
#endif

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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__)
@ -33,3 +34,5 @@
#undef ALLOW_SAM3X8E
#undef REQUIRE_MEGA2560
#endif

View file

@ -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.'"
@ -31,3 +32,5 @@
#undef ALLOW_MEGA1280
#undef ALLOW_MEGA2560
#endif

View file

@ -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__)
@ -40,3 +41,5 @@
#undef ALLOW_MEGA644
#undef ALLOW_MEGA644P
#undef REQUIRE_MEGA644P
#endif

View file

@ -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)
@ -30,3 +31,5 @@
#endif
#undef ALLOW_STM32F4
#endif

View file

@ -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"

View file

@ -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)

View file

@ -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

View file

@ -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"

View file

@ -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 <https://www.gnu.org/licenses/>.
*
*/
#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 ONBOARD_SDIO
#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

View file

@ -19,10 +19,13 @@
* 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(STM32F4) && (DISABLED(ALLOW_STM32DUINO) || NOT_TARGET(STM32F4xx))
#error "Oops! Select an STM32F4 board in 'Tools > Board.'"
#endif
#undef ALLOW_STM32DUINO
#endif

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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(STM32G0xx) || NOT_TARGET(STM32G0B1xx)
#error "Oops! Select an STM32G0 board in 'Tools > Board.'"
#endif
#endif

View file

@ -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(STM32H7)
#error "Oops! Select an STM32H7 board in 'Tools > Board.'"
#endif
#endif

View file

@ -19,10 +19,13 @@
* 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_AT90USB1286__) && (DISABLED(ALLOW_AT90USB1286P) || NOT_TARGET(__AVR_AT90USB1286P__))
#error "Oops! Select 'Teensy++ 2.0' or 'Printrboard' in 'Tools > Board.'"
#endif
#undef ALLOW_AT90USB1286P
#endif