🚸 Improve XPT2046 touch, MKS UI calibration (#27892)

This commit is contained in:
staff1010 2025-06-10 02:37:38 +08:00 committed by GitHub
parent 348099dabb
commit c09638f821
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -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);

View file

@ -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