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

Only set touchscreen offsets if they aren't defined #19196

Merged
merged 2 commits into from
Aug 31, 2020
Merged
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
50 changes: 37 additions & 13 deletions Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,18 @@
// LVGL Configs
#if ENABLED(TFT_LVGL_UI_FSMC)

#define XPT2046_X_CALIBRATION 17880
#define XPT2046_Y_CALIBRATION -12234
#define XPT2046_X_OFFSET -45
#define XPT2046_Y_OFFSET 349
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION 17880
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION -12234
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET -45
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET 349
#endif

// Emulated DOGM Configs
#elif ENABLED(FSMC_GRAPHICAL_TFT)
Expand Down Expand Up @@ -244,10 +252,18 @@
#define FSMC_DMA_DEV DMA2
#define FSMC_DMA_CHANNEL DMA_CH5

#define XPT2046_X_CALIBRATION -12246
#define XPT2046_Y_CALIBRATION 9453
#define XPT2046_X_OFFSET 360
#define XPT2046_Y_OFFSET -22
#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION -12246
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION 9453
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET 360
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET -22
#endif

#define TOUCH_CS_PIN PA7 // SPI2_NSS
#define TOUCH_SCK_PIN PB13 // SPI2_SCK
Expand All @@ -265,11 +281,19 @@
#define ILI9341_COLOR_RGB

#elif ENABLED(TFT_480x320)
#define XPT2046_X_CALIBRATION 17880
#define XPT2046_Y_CALIBRATION -12234
#define XPT2046_X_OFFSET -45
#define XPT2046_Y_OFFSET 349

#ifndef XPT2046_X_CALIBRATION
#define XPT2046_X_CALIBRATION 17880
#endif
#ifndef XPT2046_Y_CALIBRATION
#define XPT2046_Y_CALIBRATION -12234
#endif
#ifndef XPT2046_X_OFFSET
#define XPT2046_X_OFFSET -45
#endif
#ifndef XPT2046_Y_OFFSET
#define XPT2046_Y_OFFSET 349
#endif

#define TFT_DRIVER ILI9488
#define TFT_BUFFER_SIZE 14400
#define ILI9488_ORIENTATION ILI9488_MADCTL_MX | ILI9488_MADCTL_MV
Expand Down