From 556616c4f0c350006328246dd0ec6c810e2e0f88 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 May 2024 14:33:48 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Controller?= =?UTF-8?q?=20warning=20as=20macro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 12 +++------ Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 12 +++------ Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h | 4 +-- .../src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 9 +++---- Marlin/src/pins/pins.h | 9 +++++++ Marlin/src/pins/ramps/pins_RAMPS.h | 8 ++---- Marlin/src/pins/samd/pins_RAMPS_144.h | 8 ++---- Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h | 13 +++------ .../stm32f1/pins_BTT_SKR_MINI_E3_common.h | 27 ++++++------------- Marlin/src/pins/stm32f1/pins_CREALITY_V4.h | 4 +-- Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h | 4 +-- Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h | 16 +++-------- .../pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 4 +-- .../stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h | 12 +++------ .../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 4 +-- Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h | 4 +-- .../pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h | 8 ++---- .../pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h | 20 ++++---------- .../src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h | 4 +-- .../stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h | 4 +-- 20 files changed, 56 insertions(+), 130 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index 664a179c1a90..210df06d3c05 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -232,9 +232,7 @@ #elif ENABLED(ANET_FULL_GRAPHICS_LCD) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_V1_3", "ANET_FULL_GRAPHICS_LCD") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -268,9 +266,7 @@ #elif ENABLED(WYH_L12864) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! WYH_L12864 requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_V1_3", "WYH_L12864") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -366,9 +362,7 @@ #elif ENABLED(MKS_TS35_V2_0) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! MKS_TS35_V2_0 requires wiring modifications. The SKR 1.3 EXP ports are rotated 180° from what the MKS_TS35_V2_0 expects. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this error.)" - #endif + CONTROLLER_WARNING("BTT_SKR_V1_3", "MKS_TS35_V2_0", " The SKR 1.3 EXP ports are rotated 180°.") /** ------ ------ * BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 60ceab5f89d0..6345001b118b 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -296,9 +296,7 @@ #elif HAS_WIRED_LCD #if ENABLED(CTC_A10S_A13) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! CTC_A10S_A13 requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_V1_4", "CTC_A10S_A13") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -330,9 +328,7 @@ #define BEEPER_PIN EXP1_08_PIN #elif ENABLED(ANET_FULL_GRAPHICS_LCD) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_V1_4", "ANET_FULL_GRAPHICS_LCD") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. @@ -450,9 +446,7 @@ #elif ENABLED(MKS_TS35_V2_0) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! MKS_TS35_V2_0 requires wiring modifications. The SKR 1.4 EXP ports are rotated 180° from what the MKS_TS35_V2_0 expects. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this error.)" - #endif + CONTROLLER_WARNING("BTT_SKR_V1_4", "MKS_TS35_V2_0", " The SKR 1.4 EXP ports are rotated 180°.") /** ------ ------ * BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index 8cbe9a7e7e9f..14d6178a1a38 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -307,9 +307,7 @@ #elif ENABLED(ZONESTAR_LCD) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD on REARM requires wiring modifications. NB. ADCs are not 5V tolerant. See 'pins_RAMPS_RE_ARM.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("RAMPS_RE_ARM", "ZONESTAR_LCD", " ADCs are not 5V tolerant.") #elif IS_TFTGLCD_PANEL diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index a3754a391c37..074ee067a69b 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -218,9 +218,8 @@ #define EXP1_08_PIN P0_18 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable with TX = P0_15, RX = P0_16. See 'pins_BTT_SKR_E3_TURBO.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + + CONTROLLER_WARNING("BTT_SKR_E3_TURBO", "Ender-3 V2 display", " Requires a custom cable with TX = P0_15, RX = P0_16.") /** * Ender-3 V2 display SKR E3 Turbo (EXP1) Ender-3 V2 display --> SKR E3 Turbo @@ -254,9 +253,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_E3_TURBO.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_E3_TURBO", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index cdc4fdb7a406..18bb48a918c7 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -123,6 +123,12 @@ #define NOT_TARGET NONE #endif +#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING + #define CONTROLLER_WARNING(PF,CN,V...) static_assert(false, "\n\nWARNING! " CN " requires wiring modification! See pins_" PF ".h for details." V "\n (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)\n\n"); +#else + #define CONTROLLER_WARNING(...) +#endif + // // RAMPS 1.3 / 1.4 / 1.6+ - ATmega1280, ATmega2560 // @@ -1071,3 +1077,6 @@ // Post-process pins according to configured settings // #include "pins_postprocess.h" + +// Cleanup +#undef CONTROLLER_WARNING diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 38684391021b..7c641c992dd5 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -645,9 +645,7 @@ #elif ENABLED(ZONESTAR_LCD) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD on RAMPS requires wiring modifications. It plugs into AUX2 but GND and 5V need to be swapped. See 'pins_RAMPS.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("RAMPS", "ZONESTAR_LCD", " Plugs into AUX2 but GND and 5V must be swapped.") #define LCD_PINS_RS AUX2_05 #define LCD_PINS_EN AUX2_07 @@ -936,9 +934,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_RAMPS.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("RAMPS", "LCD_FYSETC_TFT81050") /** * FYSETC TFT-81050 display pinout diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index 39061efb2d6f..2eaf27d37ae1 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -465,9 +465,7 @@ #elif ENABLED(ZONESTAR_LCD) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD on RAMPS requires wiring modifications. It plugs into AUX2 but GND and 5V need to be swapped. See 'pins_RAMPS.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("RAMPS_144", "ZONESTAR_LCD", " Plugs into AUX2 but GND and 5V must be swapped.") #define LCD_PINS_RS AUX2_05 #define LCD_PINS_EN AUX2_07 @@ -749,9 +747,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_RAMPS.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("RAMPS_144", "LCD_FYSETC_TFT81050") /** * FYSETC TFT-81050 display pinout diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h index d67c0a341db5..a3794bf448b7 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_E3_DIP.h @@ -212,9 +212,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_DIP.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_E3_DIP", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -250,9 +248,8 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! FYSETC_MINI_12864_2_1 and it's clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_DIP.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_E3_DIP", "FYSETC_MINI_12864_2_1 and clones") + #if SD_CONNECTION_IS(LCD) #error "The LCD SD Card is not supported with this configuration." #endif @@ -318,9 +315,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_E3_DIP.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_E3_DIP", "LCD_FYSETC_TFT81050") /** FYSETC TFT TFT81050 display pinout * diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h index 4cfd75088fe7..4c5cccfab125 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_common.h @@ -156,6 +156,9 @@ #define TFT_03 PA2 #if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI + + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "Ender-3 V2 display") + /** * ------ ------ ------ * (ENT) | 1 2 | (BEEP) |10 9 | |10 9 | @@ -169,10 +172,6 @@ * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on. */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif - #define BEEPER_PIN EXP1_02_PIN #define BTN_EN1 EXP1_08_PIN #define BTN_EN2 EXP1_07_PIN @@ -194,9 +193,7 @@ #elif ENABLED(LCD_FOR_MELZI) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD for Melzi v4 display requires a custom cable. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "LCD for Melzi v4", " Requires a custom cable.") /** * LCD for Melzi v4 needs a custom cable with reversed GND/5V pins; plugging in a standard cable may damage the board or LCD! @@ -225,9 +222,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -255,9 +250,7 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "TFTGLCD_PANEL_SPI") /** * TFTGLCD_PANEL_SPI display pinout @@ -294,9 +287,7 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "FYSETC_MINI_12864_2_1 and clones") /** * FYSETC_MINI_12864_2_1 / MKS_MINI_12864_V3 / BTT_MINI_12864 / BEEZ_MINI_12864 display pinout @@ -364,9 +355,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_common", "LCD_FYSETC_TFT81050") /** * FYSETC TFT TFT81050 display pinout diff --git a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h index aa836d275bf4..9ae858f2d08d 100644 --- a/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h +++ b/Marlin/src/pins/stm32f1/pins_CREALITY_V4.h @@ -253,9 +253,7 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_CREALITY_V4.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning." - #endif + CONTROLLER_WARNING("CREALITY_V4", "FYSETC_MINI_12864_2_1 and clones") #if SD_CONNECTION_IS(LCD) #error "The LCD SD Card is not connected with this configuration." diff --git a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h index 33440e30dd1d..8be9f5db8362 100644 --- a/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h +++ b/Marlin/src/pins/stm32f1/pins_PANDA_PI_V29.h @@ -181,9 +181,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_PANDA_PI_V29.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("PANDA_PI_V29", "LCD_FYSETC_TFT81050") /** FYSETC TFT TFT81050 display pinout * diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index 32f56e31fd9a..1ec7e7516335 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -223,9 +223,7 @@ #if ENABLED(LCD_FOR_MELZI) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD_FOR_MELZI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_E3_RRF", "LCD_FOR_MELZI") /** LCD_FOR_MELZI display pinout * @@ -259,9 +257,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_E3_RRF", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -289,9 +285,7 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_E3_RRF", "TFTGLCD_PANEL_SPI") /** * TFTGLCD_PANEL_SPI display pinout @@ -345,9 +339,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_E3_RRF.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_E3_RRF", "LCD_FYSETC_TFT81050") /** FYSETC TFT TFT81050 display pinout * diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index 294782029658..1bfc6c5492bb 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -442,9 +442,7 @@ * orientation as the existing plug/DWIN to EXP1. TX/RX need to be connected to the TFT port, with TX->RX, RX->TX. */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable. See 'pins_BTT_OCTOPUS_V1_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_OCTOPUS_V1_common", "Ender-3 V2 display") #define BEEPER_PIN EXP1_06_PIN #define BTN_EN1 EXP1_08_PIN 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 dfeb54513098..b833a8da52cd 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 @@ -218,9 +218,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0_1", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -248,9 +246,7 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0_1", "TFTGLCD_PANEL_SPI") /** * TFTGLCD_PANEL_SPI display pinout @@ -293,9 +289,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0_1", "LCD_FYSETC_TFT81050") /** * FYSETC TFT TFT81050 display pinout diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h index 0e1d2a32d8ac..c751f9b04119 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -465,9 +465,7 @@ #elif ENABLED(WYH_L12864) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! WYH_L12864 requires wiring modifications. See 'pins_BTT_SKR_PRO_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_PRO_common", "WYH_L12864") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. diff --git a/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h b/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h index 98a54ffb0df5..6cd09d3ac884 100644 --- a/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h +++ b/Marlin/src/pins/stm32f4/pins_I3DBEEZ9.h @@ -513,9 +513,7 @@ #elif ENABLED(WYH_L12864) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! WYH_L12864 requires wiring modifications. See 'pins_I3DBEEZ9.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("I3DBEEZ9", "WYH_L12864") /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. diff --git a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h index 8241750be6f5..3489fe5c8fc1 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h @@ -262,9 +262,7 @@ * (EXP1-8) PA1 <-----------> A (DWIN-8) * (EXP1-10) 5V <-----------> VCC (DWIN-10) */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable with TX = PA0, RX = PC2. See 'pins_BTT_MANTA_E3_EZ_V1_0.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_MANTA_E3_EZ_V1_0", "Ender-3 V2 display", " Requires a custom cable with TX = PA0, RX = PC2.") #define BEEPER_PIN EXP1_01_PIN #define BTN_EN1 EXP1_08_PIN @@ -287,9 +285,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_MANTA_E3_EZ_V1_0.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_MANTA_E3_EZ_V1_0", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN diff --git a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h index 81d2ff94a048..6c724ad1bf53 100644 --- a/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h +++ b/Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h @@ -201,9 +201,7 @@ * All pins are labeled as printed on DWIN PCB. Connect TX-TX, A-A and so on. */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! DWIN_CREALITY_LCD requires a custom cable, see diagram above this line. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "DWIN_CREALITY_LCD", " Requires a custom cable.") #define BEEPER_PIN EXP1_02_PIN #define BTN_EN1 EXP1_08_PIN @@ -268,9 +266,7 @@ #elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD! - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "ZONESTAR_LCD") #define LCD_PINS_RS EXP1_06_PIN #define LCD_PINS_EN EXP1_02_PIN @@ -298,9 +294,7 @@ #if ENABLED(TFTGLCD_PANEL_SPI) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "TFTGLCD_PANEL_SPI") /** * TFTGLCD_PANEL_SPI display pinout @@ -337,9 +331,7 @@ #elif ENABLED(FYSETC_MINI_12864_2_1) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_V3_0.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning." - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "FYSETC_MINI_12864_2_1 and clones") /** * @@ -391,9 +383,7 @@ #if ALL(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! LCD_FYSETC_TFT81050 requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_SKR_MINI_E3_V3_0", "LCD_FYSETC_TFT81050") /** * FYSETC TFT TFT81050 display pinout diff --git a/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h b/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h index 4a4c47de2c1c..13bb1b7d8b03 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_KRAKEN_V1_0.h @@ -478,9 +478,7 @@ * orientation as the existing plug/DWIN to EXP1. TX/RX need to be connected to the TFT port, with TX->RX, RX->TX. */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable. See 'pins_BTT_OCTOPUS_V1_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_KRAKEN_V1_0", "Ender-3 V2 display") #define BEEPER_PIN EXP1_06_PIN #define BTN_EN1 EXP1_08_PIN diff --git a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h index ba24722e15d4..113b7eac290c 100644 --- a/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h +++ b/Marlin/src/pins/stm32h7/pins_BTT_OCTOPUS_PRO_V1_common.h @@ -447,9 +447,7 @@ * orientation as the existing plug/DWIN to EXP1. TX/RX need to be connected to the TFT port, with TX->RX, RX->TX. */ - #ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING - #error "CAUTION! Ender-3 V2 display requires a custom cable. See 'pins_BTT_OCTOPUS_V1_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)" - #endif + CONTROLLER_WARNING("BTT_OCTOPUS_PRO_V1_common", "Ender-3 V2 display") #define BEEPER_PIN EXP1_06_PIN #define BTN_EN1 EXP1_08_PIN