From c09638f821747ff86e3db402aff8f62c7dd8abbc Mon Sep 17 00:00:00 2001 From: staff1010 <132726146+staff1010@users.noreply.github.com> Date: Tue, 10 Jun 2025 02:37:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Improve=20XPT2046=20touch,=20MKS?= =?UTF-8?q?=20UI=20calibration=20(#27892)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/STM32/tft/xpt2046.h | 6 +++++- Marlin/src/gcode/lcd/M995.cpp | 2 ++ Marlin/src/lcd/extui/mks_ui/draw_touch_calibration.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Marlin/src/HAL/STM32/tft/xpt2046.h b/Marlin/src/HAL/STM32/tft/xpt2046.h index 685c9441ae..f3d3e53291 100644 --- a/Marlin/src/HAL/STM32/tft/xpt2046.h +++ b/Marlin/src/HAL/STM32/tft/xpt2046.h @@ -49,7 +49,11 @@ #define TOUCH_INT_PIN -1 #endif -#define XPT2046_DFR_MODE 0x00 +#if PIN_EXISTS(TOUCH_INT) + #define XPT2046_DFR_MODE 0x00 +#else + #define XPT2046_DFR_MODE 0x01 +#endif #define XPT2046_SER_MODE 0x04 #define XPT2046_CONTROL 0x80 diff --git a/Marlin/src/gcode/lcd/M995.cpp b/Marlin/src/gcode/lcd/M995.cpp index d5f825c0c8..2b698a5c58 100644 --- a/Marlin/src/gcode/lcd/M995.cpp +++ b/Marlin/src/gcode/lcd/M995.cpp @@ -28,6 +28,7 @@ #if HAS_TFT_LVGL_UI #include "../../lcd/extui/mks_ui/draw_touch_calibration.h" + #include "../../lcd/extui/mks_ui/draw_ui.h" #else #include "../../lcd/menu/menu.h" #endif @@ -38,6 +39,7 @@ void GcodeSuite::M995() { #if HAS_TFT_LVGL_UI + clear_cur_ui(); lv_draw_touch_calibration_screen(); #else ui.goto_screen(touch_screen_calibration); diff --git a/Marlin/src/lcd/extui/mks_ui/draw_touch_calibration.cpp b/Marlin/src/lcd/extui/mks_ui/draw_touch_calibration.cpp index a24d66a60d..25c50a2436 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_touch_calibration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_touch_calibration.cpp @@ -86,7 +86,7 @@ void lv_update_touch_calibration_screen() { // end calibration str = stage == CALIBRATION_SUCCESS ? GET_TEXT(MSG_CALIBRATION_COMPLETED) : GET_TEXT(MSG_CALIBRATION_FAILED); touch_calibration.calibration_end(); - lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_SIZE_X * 3 + INTERVAL_H * 4, BTN_SIZE_Y + INTERVAL_W + titleHeight, event_handler, ID_TC_RETURN); + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, 180, BTN_SIZE_Y + INTERVAL_H + titleHeight, event_handler, ID_TC_RETURN); } // draw current message