From dc6e3d083ea0dfe787652b2c9ffb96bdb25cd908 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 14 Aug 2020 05:32:01 +0200 Subject: [PATCH] TFT: Restore ILI9341 colors and reversed logic (#19010) Followup to #18877, #18901, #18817 --- .../lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp | 5 ++++- Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp index 205cafbcc..e42faf025 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp @@ -366,7 +366,7 @@ static const uint16_t ili9328_init[] = { static const uint16_t ili9341_init[] = { ESC_REG(0x0010), ESC_DELAY(10), ESC_REG(0x0001), ESC_DELAY(200), - ESC_REG(0x0036), TERN(GRAPHICAL_TFT_ROTATE_180, 0x00E8, 0x0028), + ESC_REG(0x0036), TERN(GRAPHICAL_TFT_ROTATE_180, 0x0028, 0x00E8), ESC_REG(0x003A), 0x0055, ESC_REG(0x002A), 0x0000, 0x0000, 0x0001, 0x003F, ESC_REG(0x002B), 0x0000, 0x0000, 0x0000, 0x00EF, @@ -658,6 +658,9 @@ uint8_t u8g_dev_tft_320x240_upscale_from_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, u setWindow = setWindow_ili9328; break; case 0x9341: // ILI9341 + WRITE_ESC_SEQUENCE(ili9341_init); + setWindow = setWindow_st7789v; + break; case 0x8066: // Anycubic / TronXY TFTs (480x320) WRITE_ESC_SEQUENCE(ili9488_init); setWindow = setWindow_st7789v; diff --git a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h index 2f5dbd010..490fb617d 100644 --- a/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h +++ b/Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h @@ -130,6 +130,12 @@ #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h #define DOGLCD_SCK -1 +#define FSMC_UPSCALE 2 +#define LCD_FULL_PIXEL_WIDTH 320 +#define LCD_FULL_PIXEL_HEIGHT 240 +#define LCD_PIXEL_OFFSET_X 32 +#define LCD_PIXEL_OFFSET_Y 32 + /** * Note: Alfawise U20/U30 boards DON'T use SPI2, as the hardware designer * mixed up MOSI and MISO pins. SPI is managed in SW, and needs pins