From 1ead7ce68198d5888b6a19195602679adf0cf7ab Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 15 Oct 2021 14:38:03 +1300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add,=20update=20TFT=20sanity=20c?= =?UTF-8?q?hecks=20(#22928)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/inc/Conditionals_LCD.h | 1 - Marlin/src/inc/SanityCheck.h | 11 +++++++---- Marlin/src/inc/Warnings.cpp | 4 ++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 99b360f9f0..b23e962a27 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -327,7 +327,6 @@ #if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI) #define IS_LEGACY_TFT 1 #define TFT_GENERIC - #warning "Don't forget to update your TFT settings in Configuration.h." #endif #if ANY(FSMC_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_LVGL_UI_FSMC) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 856d0c44c7..7e6683483d 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2666,12 +2666,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #undef IS_U8GLIB_SSD1306 #undef IS_EXTUI -#undef IS_LEGACY_TFT #if ANY(TFT_GENERIC, MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, TFT_TRONXY_X5SA, ANYCUBIC_TFT35, ANYCUBIC_TFT35, LONGER_LK_TFT28, ANET_ET4_TFT28, ANET_ET5_TFT35, BIQU_BX_TFT70) #if NONE(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI) #error "TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI is required for your TFT. Please enable one." - #elif 1 < ENABLED(TFT_COLOR_UI) + ENABLED(TFT_CLASSIC_UI) + ENABLED(TFT_LVGL_UI) + #elif MANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI) #error "Please select only one of TFT_COLOR_UI, TFT_CLASSIC_UI, or TFT_LVGL_UI." #endif #elif ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI) @@ -2694,8 +2693,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS #error "Please select only one of TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, or TFT_RES_1024x600." #endif -#if HAS_TFT_LVGL_UI && DISABLED(TFT_RES_480x320) - #error "(FMSC|SPI)TFT_LVGL_UI requires TFT_RES_480x320." +#if ENABLED(TFT_LVGL_UI) + #if DISABLED(TFT_RES_480x320) + #error "TFT_LVGL_UI requires TFT_RES_480x320." + #elif DISABLED(SDSUPPORT) + #error "TFT_LVGL_UI requires SDSUPPORT." + #endif #endif #if defined(GRAPHICAL_TFT_UPSCALE) && !WITHIN(GRAPHICAL_TFT_UPSCALE, 2, 4) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index a210c1b0fc..a0affac56a 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -476,6 +476,10 @@ #endif #endif +#if IS_LEGACY_TFT + #warning "Don't forget to update your TFT settings in Configuration.h." +#endif + // Ender 3 Pro (but, apparently all Creality 4.2.2 boards) #if ENABLED(EMIT_CREALITY_422_WARNING) || MB(CREALITY_V4) #warning "Creality 4.2.2 boards may have A4988 or TMC2208_STANDALONE drivers. Check your board and make sure to select the correct DRIVER_TYPE!"