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

320x240 LCD portrait mode UI #25191

Closed
wants to merge 2 commits into from
Closed
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
24 changes: 19 additions & 5 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,20 +325,20 @@
#endif

// TFT Compatibility
#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)
#if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT, TFT_320x240, TFT_240x320, TFT_480x320, TFT_320x240_SPI, TFT_240x320_SPI, TFT_480x320_SPI, TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI)
#define IS_LEGACY_TFT 1
#define TFT_GENERIC
#endif

#if ANY(FSMC_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_LVGL_UI_FSMC)
#if ANY(FSMC_GRAPHICAL_TFT, TFT_320x240, TFT_240x320, TFT_480x320, TFT_LVGL_UI_FSMC)
#define TFT_INTERFACE_FSMC
#elif ANY(SPI_GRAPHICAL_TFT, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_SPI)
#elif ANY(SPI_GRAPHICAL_TFT, TFT_320x240_SPI, TFT_240x320, TFT_480x320_SPI, TFT_LVGL_UI_SPI)
#define TFT_INTERFACE_SPI
#endif

#if EITHER(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT)
#define TFT_CLASSIC_UI
#elif ANY(TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI)
#elif ANY(TFT_320x240, TFT_240x320, TFT_480x320, TFT_320x240_SPI, TFT_240x320_SPI, TFT_480x320_SPI)
#define TFT_COLOR_UI
#elif EITHER(TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI)
#define TFT_LVGL_UI
Expand Down Expand Up @@ -1516,7 +1516,7 @@
#endif
#elif ENABLED(TFT_GENERIC)
#define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y)
#if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600)
#if NONE(TFT_RES_320x240, TFT_RES_240x320, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600)
#define TFT_RES_320x240
#endif
#if NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI)
Expand All @@ -1528,6 +1528,10 @@
#define TFT_WIDTH 320
#define TFT_HEIGHT 240
#define GRAPHICAL_TFT_UPSCALE 2
#elif ENABLED(TFT_RES_240x320)
#define TFT_WIDTH 240
#define TFT_HEIGHT 320
#define GRAPHICAL_TFT_UPSCALE 2
#elif ENABLED(TFT_RES_480x272)
#define TFT_WIDTH 480
#define TFT_HEIGHT 272
Expand Down Expand Up @@ -1579,6 +1583,12 @@
#elif ENABLED(TFT_INTERFACE_FSMC)
#define TFT_320x240
#endif
#elif TFT_WIDTH == 240
#if ENABLED(TFT_INTERFACE_SPI)
#define TFT_240x320_SPI
#elif ENABLED(TFT_INTERFACE_FSMC)
#define TFT_240x320
#endif
#elif TFT_HEIGHT == 320
#if ENABLED(TFT_INTERFACE_SPI)
#define TFT_480x320_SPI
Expand All @@ -1602,6 +1612,8 @@

#if EITHER(TFT_320x240, TFT_320x240_SPI)
#define HAS_UI_320x240 1
#elif EITHER(TFT_240x320, TFT_240x320_SPI)
#define HAS_UI_240x320 1
#elif EITHER(TFT_480x320, TFT_480x320_SPI)
#define HAS_UI_480x320 1
#elif EITHER(TFT_480x272, TFT_480x272_SPI)
Expand All @@ -1611,6 +1623,8 @@
#endif
#if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272)
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen
#elif HAS_UI_240x320
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 6) // Fewer lines with touch buttons onscreen
#elif HAS_UI_1024x600
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -3022,7 +3022,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
+ COUNT_ENABLED(MKS_MINI_12864_V3, BTT_MINI_12864_V1) \
+ (ENABLED(EXTENSIBLE_UI) && DISABLED(IS_EXTUI)) \
+ (DISABLED(IS_LEGACY_TFT) && ENABLED(TFT_GENERIC)) \
+ (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_480x320, TFT_480x320_SPI)) \
+ (ENABLED(IS_LEGACY_TFT) && COUNT_ENABLED(TFT_320x240, TFT_320x240_SPI, TFT_240x320, TFT_240x320_SPI, TFT_480x320, TFT_480x320_SPI)) \
+ COUNT_ENABLED(ANYCUBIC_LCD_I3MEGA, ANYCUBIC_LCD_CHIRON, ANYCUBIC_TFT35) \
+ DGUS_UI_IS(ORIGIN) + DGUS_UI_IS(FYSETC) + DGUS_UI_IS(HIPRECY) + DGUS_UI_IS(MKS) + DGUS_UI_IS(RELOADED) + DGUS_UI_IS(IA_CREALITY) \
+ COUNT_ENABLED(ENDER2_STOCKDISPLAY, CR10_STOCKDISPLAY) \
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/lcd/tft/tft.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#if HAS_UI_320x240
#define TFT_WIDTH 320
#define TFT_HEIGHT 240
#elif HAS_UI_240x320
#define TFT_WIDTH 240
#define TFT_HEIGHT 320
#elif HAS_UI_480x320
#define TFT_WIDTH 480
#define TFT_HEIGHT 320
Expand Down
Loading