Skip to content

Commit

Permalink
Move TFT_DRIVER
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Aug 22, 2020
1 parent 52f7ead commit ee81a59
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
18 changes: 14 additions & 4 deletions Marlin/src/lcd/tft/tft.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,26 @@
#define AUTO 0xFFFF

#ifndef TFT_DRIVER
#define TFT_DRIVER AUTO
#if ENABLED(TFT_480x320)
#define TFT_DRIVER ILI9488 // Color UI
#elif ENABLED(TFT_320x240)
#define TFT_DRIVER ILI9341 // TFT32/28
#elif ENABLED(TFT_480x320_SPI)
#define TFT_DRIVER ST7796
#else
#define TFT_DRIVER AUTO
#endif
#endif

#ifndef TFT_BUFFER_SIZE
#ifdef STM32F103xB
#define TFT_BUFFER_SIZE 1024
#if ANY(TFT_480x320, TFT_320x240, TFT_480x320_SPI)
#define TFT_BUFFER_SIZE 14400
#elif defined(STM32F103xB)
#define TFT_BUFFER_SIZE 1024
#elif defined(STM32F103xE)
#define TFT_BUFFER_SIZE 19200 // 320 * 60
#elif defined(STM32F1)
#define TFT_BUFFER_SIZE 8192
#define TFT_BUFFER_SIZE 8192
#else
#define TFT_BUFFER_SIZE 19200 // 320 * 60
#endif
Expand Down
3 changes: 0 additions & 3 deletions Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@
// Color UI Configs
#elif ENABLED(TFT_480x320)

#define TFT_DRIVER ILI9488
#define TFT_BUFFER_SIZE 14400

#define XPT2046_X_CALIBRATION -17181
#define XPT2046_Y_CALIBRATION 11434
#define XPT2046_X_OFFSET 501
Expand Down
3 changes: 0 additions & 3 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
#define TOUCH_MOSI_PIN PB15 // SPI2_MOSI

#define TFT_DRIVER ILI9341
#define TFT_BUFFER_SIZE 14400

// YV for normal screen mounting
#define ILI9341_ORIENTATION ILI9341_MADCTL_MY | ILI9341_MADCTL_MV
// XV for 180° rotated screen mounting
Expand Down
5 changes: 0 additions & 5 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,6 @@
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
#define TOUCH_MOSI_PIN PB15 // SPI2_MOSI

#define TFT_DRIVER ILI9341
#define TFT_BUFFER_SIZE 14400

// YV for normal screen mounting
//#define ILI9341_ORIENTATION ILI9341_MADCTL_MY | ILI9341_MADCTL_MV
// XV for 180° rotated screen mounting
Expand All @@ -270,8 +267,6 @@
#define XPT2046_X_OFFSET -45
#define XPT2046_Y_OFFSET 349

#define TFT_DRIVER ILI9488
#define TFT_BUFFER_SIZE 14400
#define ILI9488_ORIENTATION ILI9488_MADCTL_MX | ILI9488_MADCTL_MV
#endif

Expand Down
10 changes: 4 additions & 6 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,11 @@
#define LCD_PINS_RS PC6

#elif ENABLED(TFT_480x320_SPI)
#define XPT2046_X_CALIBRATION -17253
#define XPT2046_Y_CALIBRATION 11579
#define XPT2046_X_OFFSET 514
#define XPT2046_Y_OFFSET -24

#define TFT_DRIVER ST7796
#define TFT_BUFFER_SIZE 14400
#define XPT2046_X_CALIBRATION -17253
#define XPT2046_Y_CALIBRATION 11579
#define XPT2046_X_OFFSET 514
#define XPT2046_Y_OFFSET -24

#endif

Expand Down

0 comments on commit ee81a59

Please sign in to comment.