Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak tests and consolidate pins target validation #21254

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Marlin/src/pins/esp32/env_validate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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

#if NOT_TARGET(ARDUINO_ARCH_ESP32)
#error "Oops! Select an ESP32 board in 'Tools > Board.'"
#endif
6 changes: 3 additions & 3 deletions Marlin/src/pins/esp32/pins_E4D.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
* for more info check https://atbox.tech/ and join to Facebook page E4d@box.
*/

#if NOT_TARGET(ARDUINO_ARCH_ESP32)
#error "Oops! Select an ESP32 board in 'Tools > Board.'"
#elif EXTRUDERS > 1 || E_STEPPERS > 1
#include "env_validate.h"

#if EXTRUDERS > 1 || E_STEPPERS > 1
#error "E4d@box only supports one E Stepper. Comment out this line to continue."
#elif HOTENDS > 1
#error "E4d@box only supports one hotend / E-stepper. Comment out this line to continue."
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/esp32/pins_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* Espressif ESP32 (Tensilica Xtensa LX6) pin assignments
*/

#if NOT_TARGET(ARDUINO_ARCH_ESP32)
"Oops! Select an ESP32 board in 'Tools > Board.'"
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "Espressif ESP32"

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/esp32/pins_FYSETC_E4.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
* Supports 4 stepper drivers, heated bed, single hotend.
*/

#ifndef ARDUINO_ARCH_ESP32
#error "Oops! Select an ESP32 board in 'Tools > Board.'"
#elif EXTRUDERS > 1 || E_STEPPERS > 1
#include "env_validate.h"

#if EXTRUDERS > 1 || E_STEPPERS > 1
#error "FYSETC E4 only supports one E Stepper. Comment out this line to continue."
#elif HOTENDS > 1
#error "FYSETC E4 only supports one hotend / E-stepper. Comment out this line to continue."
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/esp32/pins_MRR_ESPA.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
* Supports 4 stepper drivers, heated bed, single hotend.
*/

#if NOT_TARGET(ARDUINO_ARCH_ESP32)
#error "Oops! Select an ESP32 board in 'Tools > Board.'"
#elif EXTRUDERS > 1 || E_STEPPERS > 1
#include "env_validate.h"

#if EXTRUDERS > 1 || E_STEPPERS > 1
#error "MRR ESPA only supports one E Stepper. Comment out this line to continue."
#elif HOTENDS > 1
#error "MRR ESPA only supports one hotend / E-stepper. Comment out this line to continue."
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/pins/esp32/pins_MRR_ESPE.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
* single hotend, and LCD controller.
*/

#if NOT_TARGET(ARDUINO_ARCH_ESP32)
#error "Oops! Select an ESP32 board in 'Tools > Board.'"
#elif EXTRUDERS > 2 || E_STEPPERS > 2
#include "env_validate.h"

#if EXTRUDERS > 2 || E_STEPPERS > 2
#error "MRR ESPE only supports two E Steppers. Comment out this line to continue."
#elif HOTENDS > 1
#error "MRR ESPE only supports one hotend / E-stepper. Comment out this line to continue."
Expand Down
30 changes: 30 additions & 0 deletions Marlin/src/pins/lpc1768/env_validate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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

#if ENABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#elif DISABLED(REQUIRE_LPC1769) && NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif

#undef REQUIRE_LPC1769
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1768/pins_AZSMZ_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* AZSMZ MINI pin assignments
*/

#if NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "AZSMZ MINI"

Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1768/pins_BIQU_B300_V1.0.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
* BOARD_BIQU_BQ111_A4 (Hotend, Fan, Bed)
*/

#if NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#include "env_validate.h"

#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "BIQU Thunder B300 V1.0"
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1768/pins_BIQU_BQ111_A4.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
* BOARD_BIQU_BQ111_A4 (Hotend, Fan, Bed)
*/

#if NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "BIQU BQ111-A4"

Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
*/
#pragma once

#include "env_validate.h"

#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "BTT SKR V1.4"
#endif

#ifndef BOARD_CUSTOM_BUILD_FLAGS
#define BOARD_CUSTOM_BUILD_FLAGS -DLPC_PINCFG_UART3_P4_28
#endif

//
// SD Connection
//
Expand Down
8 changes: 1 addition & 7 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@
*/
#pragma once

#if ENABLED(SKR_HAS_LPC1769)
#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
#elif NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#include "env_validate.h"

// If you have the Big tree tech driver expansion module, enable HAS_BTT_EXP_MOT
// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
*/
#pragma once

#if NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "GMARSH X6 REV1"

Expand Down
6 changes: 1 addition & 5 deletions Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@
* MKS SBASE pin assignments
*/

#if defined(MKS_HAS_LPC1769) && NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#elif !defined(MKS_HAS_LPC1769) && NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#include "env_validate.h"

#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "MKS SBASE"
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* MKS SGEN-L pin assignments
*/

#if NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "MKS SGen-L"
#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN_L"
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@

// Numbers in parentheses () are the corresponding mega2560 pin numbers

#if NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "Re-ARM RAMPS 1.4"

Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1768/pins_SELENA_COMPACT.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* Selena Compact pin assignments
*/

#if NOT_TARGET(MCU_LPC1768)
#error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "Selena Compact"
#define BOARD_WEBSITE_URL "github.com/Ales2-k/Selena"
Expand Down
26 changes: 26 additions & 0 deletions Marlin/src/pins/lpc1769/env_validate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2021 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

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* Azteeg X5 GT pin assignments
*/

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "Azteeg X5 GT"
#define BOARD_WEBSITE_URL "tinyurl.com/yx8tdqa3"
Expand Down
5 changes: 1 addition & 4 deletions Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
/**
* Azteeg X5 MINI pin assignments
*/

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
#include "env_validate.h"

#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "Azteeg X5 MINI"
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/pins/lpc1769/pins_AZTEEG_X5_MINI_WIFI.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
#pragma once

/**
* Azteeg X5 MINI pin assignments
* Azteeg X5 MINI WIFI pin assignments
*/

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "Azteeg X5 MINI WIFI"

Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*/
#pragma once

#include "env_validate.h"

#ifndef BOARD_INFO_NAME
#define BOARD_INFO_NAME "BTT SKR E3 Turbo"
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/lpc1769/pins_BTT_SKR_V1_4_TURBO.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#pragma once

#define BOARD_INFO_NAME "BTT SKR V1.4 TURBO"
#define SKR_HAS_LPC1769

//
// Include SKR 1.4 pins
//
#define REQUIRE_LPC1769
#include "../lpc1768/pins_BTT_SKR_V1_4.h"
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1769/pins_COHESION3D_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* Cohesion3D Mini pin assignments
*/

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "Cohesion3D Mini"

Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1769/pins_COHESION3D_REMIX.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* Cohesion3D ReMix pin assignments
*/

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "Cohesion3D ReMix"

Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1769/pins_FLY_CDY.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
*/
#pragma once

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "FLY-CDY"
#define BOARD_WEBSITE_URL "github.com/FLYmaker/FLY-CDY"
Expand Down
6 changes: 1 addition & 5 deletions Marlin/src/pins/lpc1769/pins_MKS_SGEN.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@
* https://github.com/makerbase-mks/MKS-SGen/blob/master/Hardware/MKS%20SGEN%20V1.0_001/MKS%20SGEN%20V1.0_001%20PIN.pdf
*/

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif

#define BOARD_INFO_NAME "MKS SGen"
#define BOARD_WEBSITE_URL "github.com/makerbase-mks/MKS-SGEN"

#define MKS_HAS_LPC1769
#define REQUIRE_LPC1769
#include "../lpc1768/pins_MKS_SBASE.h"

#if HAS_TMC_UART
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* MKS SGen pin assignments
*/

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "MKS SGEN_L V2"
#define BOARD_WEBSITE_URL "github.com/makerbase-mks"
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/pins/lpc1769/pins_SMOOTHIEBOARD.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
* Smoothieboard pin assignments
*/

#if NOT_TARGET(MCU_LPC1769)
#error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
#endif
#include "env_validate.h"

#define BOARD_INFO_NAME "Smoothieboard"
#define BOARD_WEBSITE_URL "smoothieware.org/smoothieboard"
Expand Down
Loading