Skip to content

Commit

Permalink
Support 4.3" (480x272) Color UI display (MarlinFirmware#20334)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhapsodyv authored and zillarob committed Feb 25, 2021
1 parent 9d5ec9a commit 49a04e3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
9 changes: 9 additions & 0 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,12 @@
#elif ENABLED(TFT_INTERFACE_FSMC)
#define TFT_480x320
#endif
#elif ENABLED(TFT_COLOR_UI) && TFT_HEIGHT == 272
#if ENABLED(TFT_INTERFACE_SPI)
#define TFT_480x272_SPI
#elif ENABLED(TFT_INTERFACE_FSMC)
#define TFT_480x272
#endif
#endif

// Fewer lines with touch buttons on-screen
Expand All @@ -1018,6 +1024,9 @@
#elif EITHER(TFT_480x320, TFT_480x320_SPI)
#define HAS_UI_480x320 1
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7)
#elif EITHER(TFT_480x272, TFT_480x272_SPI)
#define HAS_UI_480x272 1
#define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7)
#endif

// This emulated DOGM has 'touch/xpt2046', not 'tft/xpt2046'
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 @@ -43,6 +43,9 @@
#elif HAS_UI_480x320
#define TFT_WIDTH 480
#define TFT_HEIGHT 320
#elif HAS_UI_480x272
#define TFT_WIDTH 480
#define TFT_HEIGHT 272
#else
#error "Unsupported display resolution!"
#endif
Expand Down
13 changes: 11 additions & 2 deletions Marlin/src/lcd/tft/ui_480x320.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,17 @@ void draw_fan_status(uint16_t x, uint16_t y, const bool blink);
void menu_line(const uint8_t row, uint16_t color = COLOR_BACKGROUND);
void menu_item(const uint8_t row, bool sel = false);

#define MENU_FONT_NAME Helvetica18
#define SYMBOLS_FONT_NAME Helvetica18_symbols
#if HAS_UI_480x320
#define MENU_FONT_NAME Helvetica18
#define SYMBOLS_FONT_NAME Helvetica18_symbols
#define MENU_ITEM_HEIGHT 43
#define FONT_LINE_HEIGHT 34
#elif HAS_UI_480x272
#define MENU_FONT_NAME Helvetica14
#define SYMBOLS_FONT_NAME Helvetica14_symbols
#define MENU_ITEM_HEIGHT 36
#define FONT_LINE_HEIGHT 24
#endif

#define ABSOLUTE_ZERO -273.15

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/tft_io/ssd1963.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
IF_0((TFT_ORIENTATION) & TFT_INVERT_X, SSD1963_MADCTL_FH) | \
IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, SSD1963_MADCTL_FV)

#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_BGR
#define SSD1963_COLOR SSD1963_MADCTL_BGR
#elif TFT_COLOR == TFT_COLOR_RGB
#if !defined(TFT_COLOR) || TFT_COLOR == TFT_COLOR_RGB
#define SSD1963_COLOR SSD1963_MADCTL_RGB
#elif TFT_COLOR == TFT_COLOR_BGR
#define SSD1963_COLOR SSD1963_MADCTL_BGR
#endif

#define SSD1963_MADCTL_DATA (SSD1963_ORIENTATION) | (SSD1963_COLOR)
Expand Down
5 changes: 0 additions & 5 deletions Marlin/src/pins/stm32f4/pins_ANET_ET4.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@
#define TOUCH_INT_PIN PB1
#endif

// Touchscreen calibration does not work correctly with ANET_ET5_TFT35 or ANET_ET4_TFT28
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
#undef TOUCH_SCREEN_CALIBRATION
#endif

#if ENABLED(ANET_ET5_TFT35)
#ifndef TOUCH_CALIBRATION_X
#define TOUCH_CALIBRATION_X 17125
Expand Down

0 comments on commit 49a04e3

Please sign in to comment.