Skip to content

Commit

Permalink
Permit touch calibration override
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Oct 16, 2020
1 parent fb28c60 commit d66bc5c
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 158 deletions.
16 changes: 12 additions & 4 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,18 @@

// Emulated DOGM have xpt calibration values independent of display resolution
#if ENABLED(SPI_GRAPHICAL_TFT)
#define XPT2046_X_CALIBRATION -11245
#define XPT2046_Y_CALIBRATION 8629
#define XPT2046_X_OFFSET 685
#define XPT2046_Y_OFFSET -285
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -11245
#endif
#ifdef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 8629
#endif
#ifdef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET 685
#endif
#ifdef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -285
#endif
#endif

#elif IS_TFTGLCD_PANEL
Expand Down
38 changes: 19 additions & 19 deletions Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@
#define FIL_RUNOUT_PIN PA15

// SPI Flash
#define SPI_FLASH_SIZE 0x200000 // 2MB
#define HAS_SPI_FLASH 1
#if HAS_SPI_FLASH
#define SPI_FLASH_SIZE 0x200000 // 2MB
#endif

// SPI 2
#define W25QXX_CS_PIN PB12
Expand Down Expand Up @@ -146,38 +148,36 @@
#endif

#if HAS_TFT_LVGL_UI

// LVGL

#define HAS_SPI_FLASH_FONT 1
#define HAS_GCODE_PREVIEW 1
#define HAS_GCODE_DEFAULT_VIEW_IN_FLASH 0
#define HAS_LANG_SELECT_SCREEN 1
#define HAS_BAK_VIEW_IN_FLASH 0
#define HAS_LOGO_IN_FLASH 0

#define XPT2046_X_CALIBRATION -17181
#define XPT2046_Y_CALIBRATION 11434
#define XPT2046_X_OFFSET 501
#define XPT2046_Y_OFFSET -9

#elif ENABLED(TFT_480x320)

// Color UI

#define TFT_DRIVER ILI9488
#define TFT_BUFFER_SIZE 14400

#define XPT2046_X_CALIBRATION -17181
#define XPT2046_Y_CALIBRATION 11434
#define XPT2046_X_OFFSET 501
#define XPT2046_Y_OFFSET -9

#elif ENABLED(FSMC_GRAPHICAL_TFT)

// Emulated DOGM

#define GRAPHICAL_TFT_UPSCALE 3
#endif

#if EITHER(HAS_TFT_LVGL_UI, TFT_480x320)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -17181
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 11434
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET 501
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -9
#endif
#elif ENABLED(FSMC_GRAPHICAL_TFT)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -12316
#endif
Expand Down
40 changes: 21 additions & 19 deletions Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@
#endif

// SPI Flash
#define SPI_FLASH_SIZE 0x200000 // 2MB
#define HAS_SPI_FLASH 1
#if HAS_SPI_FLASH
#define SPI_FLASH_SIZE 0x200000 // 2MB
#endif

// SPI 2
#define W25QXX_CS_PIN PB12
Expand Down Expand Up @@ -158,36 +160,37 @@

#endif

// LVGL Configs
#if HAS_TFT_LVGL_UI

// LVGL
#define HAS_SPI_FLASH_FONT 1
#define HAS_GCODE_PREVIEW 1
#define HAS_GCODE_DEFAULT_VIEW_IN_FLASH 0
#define HAS_LANG_SELECT_SCREEN 1
#define HAS_BAK_VIEW_IN_FLASH 0
#define HAS_LOGO_IN_FLASH 0

#define XPT2046_X_CALIBRATION -17181
#define XPT2046_Y_CALIBRATION 11434
#define XPT2046_X_OFFSET 501
#define XPT2046_Y_OFFSET -9

// Color UI Configs
#elif ENABLED(TFT_480x320)

// Color UI
#define TFT_DRIVER ILI9488
#define TFT_BUFFER_SIZE 14400

#define XPT2046_X_CALIBRATION -17181
#define XPT2046_Y_CALIBRATION 11434
#define XPT2046_X_OFFSET 501
#define XPT2046_Y_OFFSET -9

// Emulated DOGM
#elif ENABLED(FSMC_GRAPHICAL_TFT)
// Emulated DOGM
#define GRAPHICAL_TFT_UPSCALE 3
#endif

#if EITHER(HAS_TFT_LVGL_UI, TFT_480x320)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -17181
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 11434
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET 501
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -9
#endif
#elif ENABLED(FSMC_GRAPHICAL_TFT)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -12316
#endif
Expand All @@ -200,7 +203,6 @@
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -20
#endif

#endif

// SPI1(PA7)=LCD & SPI3(PB5)=STUFF, are not available
Expand Down
58 changes: 28 additions & 30 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,32 +269,8 @@

#endif

#if ENABLED(TFT_LVGL_UI_SPI)

// LVGL

#define XPT2046_X_CALIBRATION -17253
#define XPT2046_Y_CALIBRATION 11579
#define XPT2046_X_OFFSET 514
#define XPT2046_Y_OFFSET -24

#elif ENABLED(SPI_GRAPHICAL_TFT)

#if ENABLED(SPI_GRAPHICAL_TFT)
// Emulated DOGM SPI

#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -11386
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 8684
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET 339
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -18
#endif

#ifndef GRAPHICAL_TFT_UPSCALE
#define GRAPHICAL_TFT_UPSCALE 3
#endif
Expand All @@ -310,14 +286,36 @@
#define LCD_PINS_RS PC6

#elif ENABLED(TFT_480x320_SPI)
#define TFT_DRIVER ST7796
#define TFT_BUFFER_SIZE 14400
#endif

#if EITHER(HAS_TFT_LVGL_UI, TFT_480x320_SPI)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -17253
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 11579
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET 514
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -24

#define TFT_DRIVER ST7796
#define TFT_BUFFER_SIZE 14400

#endif
#elif ENABLED(SPI_GRAPHICAL_TFT)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -11386
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 8684
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET 339
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -18
#endif
#endif

#if HAS_WIRED_LCD && !HAS_SPI_TFT
Expand Down Expand Up @@ -364,8 +362,8 @@
#endif // HAS_WIRED_LCD && !HAS_SPI_TFT

#define HAS_SPI_FLASH 1
#define SPI_FLASH_SIZE 0x1000000 // 16MB
#if HAS_SPI_FLASH
#define SPI_FLASH_SIZE 0x1000000 // 16MB
#define W25QXX_CS_PIN PB12
#define W25QXX_MOSI_PIN PB15
#define W25QXX_MISO_PIN PB14
Expand Down
20 changes: 15 additions & 5 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,20 @@
* If the screen stays white, disable 'LCD_RESET_PIN'
* to let the bootloader init the screen.
*/
#define XPT2046_X_CALIBRATION 12033
#define XPT2046_Y_CALIBRATION -9047
#define XPT2046_X_OFFSET -30
#define XPT2046_Y_OFFSET 254
#if ENABLED(TOUCH_SCREEN)
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION 12033
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION -9047
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET -30
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET 254
#endif
#endif

#if ENABLED(FSMC_GRAPHICAL_TFT)

Expand Down Expand Up @@ -191,8 +201,8 @@
#endif

#define HAS_SPI_FLASH 1
#define SPI_FLASH_SIZE 0x1000000 // 16MB
#if HAS_SPI_FLASH
#define SPI_FLASH_SIZE 0x1000000 // 16MB
#define W25QXX_CS_PIN PB12 // Flash chip-select
#define W25QXX_MOSI_PIN PB15
#define W25QXX_MISO_PIN PB14
Expand Down
Loading

0 comments on commit d66bc5c

Please sign in to comment.