Skip to content

Commit

Permalink
🔧 Add, update TFT sanity checks (#22928)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored and thinkyhead committed Dec 25, 2021
1 parent dffa564 commit 1ead7ce
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 7 additions & 4 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/inc/Warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down

0 comments on commit 1ead7ce

Please sign in to comment.