diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ea77b4e429..93506e1920 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2340,10 +2340,10 @@ #define TOUCH_SCREEN_CALIBRATION - //#define XPT2046_X_CALIBRATION 12316 - //#define XPT2046_Y_CALIBRATION -8981 - //#define XPT2046_X_OFFSET -43 - //#define XPT2046_Y_OFFSET 257 + //#define TOUCH_CALIBRATION_X 12316 + //#define TOUCH_CALIBRATION_Y -8981 + //#define TOUCH_OFFSET_X -43 + //#define TOUCH_OFFSET_Y 257 #if ENABLED(TFT_COLOR_UI) //#define SINGLE_TOUCH_NAVIGATION diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 3762d40c53..5b42efeeef 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -3162,17 +3162,17 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2) * Touch Buttons */ #if ENABLED(TOUCH_SCREEN) - #ifndef XPT2046_X_CALIBRATION - #error "XPT2046_X_CALIBRATION must be defined with TOUCH_SCREEN." + #ifndef TOUCH_CALIBRATION_X + #error "TOUCH_CALIBRATION_X must be defined with TOUCH_SCREEN." #endif - #ifndef XPT2046_Y_CALIBRATION - #error "XPT2046_Y_CALIBRATION must be defined with TOUCH_SCREEN." + #ifndef TOUCH_CALIBRATION_Y + #error "TOUCH_CALIBRATION_Y must be defined with TOUCH_SCREEN." #endif - #ifndef XPT2046_X_OFFSET - #error "XPT2046_X_OFFSET must be defined with TOUCH_SCREEN." + #ifndef TOUCH_OFFSET_X + #error "TOUCH_OFFSET_X must be defined with TOUCH_SCREEN." #endif - #ifndef XPT2046_Y_OFFSET - #error "XPT2046_Y_OFFSET must be defined with TOUCH_SCREEN." + #ifndef TOUCH_OFFSET_Y + #error "TOUCH_OFFSET_Y must be defined with TOUCH_SCREEN." #endif #endif diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 21e3040c2e..48cadf8f4c 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -241,8 +241,8 @@ static bool get_point(int16_t *x, int16_t *y) { bool is_touched = touch.getRawPoint(x, y); if (is_touched) { - *x = int16_t((int32_t(*x) * XPT2046_X_CALIBRATION) >> 16) + XPT2046_X_OFFSET; - *y = int16_t((int32_t(*y) * XPT2046_Y_CALIBRATION) >> 16) + XPT2046_Y_OFFSET; + *x = int16_t((int32_t(*x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; + *y = int16_t((int32_t(*y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; } #if (TFT_ROTATION & TFT_ROTATE_180) diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 1239b31f2f..112ff0b438 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -257,8 +257,8 @@ bool Touch::get_point(int16_t *x, int16_t *y) { } #else bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y)); - *x = uint16_t((uint32_t(*x) * XPT2046_X_CALIBRATION) >> 16) + XPT2046_X_OFFSET; - *y = uint16_t((uint32_t(*y) * XPT2046_Y_CALIBRATION) >> 16) + XPT2046_Y_OFFSET; + *x = uint16_t((uint32_t(*x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; + *y = uint16_t((uint32_t(*y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; #endif return is_touched; } diff --git a/Marlin/src/lcd/tft_io/touch_calibration.h b/Marlin/src/lcd/tft_io/touch_calibration.h index f70d214a12..ff539d0edc 100644 --- a/Marlin/src/lcd/tft_io/touch_calibration.h +++ b/Marlin/src/lcd/tft_io/touch_calibration.h @@ -48,6 +48,10 @@ #endif #endif +#ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE +#endif + #if ENABLED(TOUCH_SCREEN_CALIBRATION) typedef struct __attribute__((__packed__)) { diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index 32aa7ced54..f6b4c73bbc 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -60,8 +60,8 @@ uint8_t TouchButtons::read_buttons() { x = int16_t((int32_t(x) * touch_calibration.calibration.x) >> 16) + touch_calibration.calibration.offset_x; y = int16_t((int32_t(y) * touch_calibration.calibration.y) >> 16) + touch_calibration.calibration.offset_y; #else - x = uint16_t((uint32_t(x) * XPT2046_X_CALIBRATION) >> 16) + XPT2046_X_OFFSET; - y = uint16_t((uint32_t(y) * XPT2046_Y_CALIBRATION) >> 16) + XPT2046_Y_OFFSET; + x = uint16_t((uint32_t(x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; + y = uint16_t((uint32_t(y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; #endif diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 14bac7d723..f2edaf0ef6 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -329,30 +329,30 @@ // XPT2046 Touch Screen calibration #if ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11245 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -11245 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8629 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 8629 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 685 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 685 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -285 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -285 #endif #elif ENABLED(TFT_480x320_SPI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17232 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17232 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11196 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11196 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 1047 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 1047 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -358 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -358 #endif #define TFT_BUFFER_SIZE 2400 diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index f948c32f92..30f2df89a3 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -270,30 +270,30 @@ // XPT2046 Touch Screen calibration #if ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11386 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -11386 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8684 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 8684 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 689 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 689 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -273 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -273 #endif #elif ENABLED(TFT_COLOR_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -16741 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -16741 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11258 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11258 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 1024 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 1024 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -367 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -367 #endif #define TFT_BUFFER_SIZE 2400 diff --git a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h index 0719752399..dee915026d 100644 --- a/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h +++ b/Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h @@ -320,30 +320,30 @@ // XPT2046 Touch Screen calibration #if ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11386 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -11386 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8684 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 8684 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 689 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 689 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -273 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -273 #endif #elif ENABLED(TFT_COLOR_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17089 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17089 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11424 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11424 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 1044 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 1044 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -365 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -365 #endif #define TFT_BUFFER_SIZE 2400 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h index b13fde026c..e3e84513af 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h @@ -158,17 +158,17 @@ // XPT2046 Touch Screen calibration #if ANY(TFT_LVGL_UI, TFT_COLOR_UI, TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17181 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17181 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11434 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11434 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 501 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 501 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -9 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -9 #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h index a015fb2704..e4597772e3 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h @@ -173,17 +173,17 @@ // XPT2046 Touch Screen calibration #if ANY(TFT_LVGL_UI, TFT_COLOR_UI, TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17181 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17181 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11434 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11434 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 501 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 501 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -9 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -9 #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index 5f91072440..e0de272d7f 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -286,22 +286,22 @@ // MKS Robin TFT v2.0 with ILI9341 // Read display identification information (0xD3 on ILI9341) -//#define XPT2046_X_CALIBRATION 12013 -//#define XPT2046_Y_CALIBRATION -8711 -//#define XPT2046_X_OFFSET -32 -//#define XPT2046_Y_OFFSET 256 +//#define TOUCH_CALIBRATION_X 12013 +//#define TOUCH_CALIBRATION_Y -8711 +//#define TOUCH_OFFSET_X -32 +//#define TOUCH_OFFSET_Y 256 // MKS Robin TFT v1.1 with ILI9328 -//#define XPT2046_X_CALIBRATION -11792 -//#define XPT2046_Y_CALIBRATION 8947 -//#define XPT2046_X_OFFSET 342 -//#define XPT2046_Y_OFFSET -19 +//#define TOUCH_CALIBRATION_X -11792 +//#define TOUCH_CALIBRATION_Y 8947 +//#define TOUCH_OFFSET_X 342 +//#define TOUCH_OFFSET_Y -19 // MKS Robin TFT v1.1 with R61505 -//#define XPT2046_X_CALIBRATION 12489 -//#define XPT2046_Y_CALIBRATION 9210 -//#define XPT2046_X_OFFSET -52 -//#define XPT2046_Y_OFFSET -17 +//#define TOUCH_CALIBRATION_X 12489 +//#define TOUCH_CALIBRATION_Y 9210 +//#define TOUCH_OFFSET_X -52 +//#define TOUCH_OFFSET_Y -17 // QQS-Pro uses MKS Robin TFT v2.0 @@ -328,31 +328,31 @@ #if EITHER(TFT_LVGL_UI_FSMC, TFT_COLOR_UI) #define TFT_BUFFER_SIZE 14400 - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION 12218 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 12218 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION -8814 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y -8814 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET -35 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -35 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET 256 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 256 #endif #elif ENABLED(TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION 12149 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 12149 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION -8746 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y -8746 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET -35 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -35 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET 256 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 256 #endif #define TFT_MARLINUI_COLOR 0xFFFF // White diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 9c0f2deeab..c98d532e34 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -284,30 +284,30 @@ // XPT2046 Touch Screen calibration #if EITHER(HAS_TFT_LVGL_UI, TFT_480x320_SPI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17253 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17253 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11579 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11579 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 514 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 514 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -24 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -24 #endif #elif HAS_SPI_GRAPHICAL_TFT - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -11386 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -11386 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 8684 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 8684 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 339 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 339 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -18 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -18 #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h index 2406c22d55..9be509ba47 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_MINI.h @@ -171,17 +171,17 @@ #endif #if ENABLED(TOUCH_SCREEN) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION 12033 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 12033 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION -9047 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y -9047 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET -30 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -30 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET 254 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 254 #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 3c9b2f5b59..77fc7e8912 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -204,30 +204,30 @@ // XPT2046 Touch Screen calibration #if ANY(HAS_TFT_LVGL_UI_FSMC, TFT_COLOR_UI, TFT_CLASSIC_UI) && ENABLED(TFT_RES_480x320) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION 17880 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 17880 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION -12234 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y -12234 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET -45 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X -45 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET 349 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 349 #endif #elif EITHER(TFT_COLOR_UI, TFT_CLASSIC_UI) && ENABLED(TFT_RES_320x240) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -12246 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -12246 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 9453 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 9453 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 360 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 360 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -22 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -22 #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index 9c1d073da6..07a04b413d 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -287,17 +287,17 @@ // XPT2046 Touch Screen calibration #if ANY(TFT_LVGL_UI, TFT_COLOR_UI, TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17253 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17253 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11579 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11579 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 514 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 514 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -24 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -24 #endif #endif diff --git a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h index 2fc34ce296..428469426e 100644 --- a/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h @@ -141,17 +141,17 @@ // XPT2046 Touch Screen calibration #if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI) - #ifndef XPT2046_X_CALIBRATION - #define XPT2046_X_CALIBRATION -17181 + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X -17181 #endif - #ifndef XPT2046_Y_CALIBRATION - #define XPT2046_Y_CALIBRATION 11434 + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 11434 #endif - #ifndef XPT2046_X_OFFSET - #define XPT2046_X_OFFSET 501 + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 501 #endif - #ifndef XPT2046_Y_OFFSET - #define XPT2046_Y_OFFSET -9 + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y -9 #endif #endif