From 7642bfbf8b997308e691034aa294a061c5fc5426 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Wed, 3 May 2023 14:19:32 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20TFT=20Touch=20Calibration?= =?UTF-8?q?=20overrides=20(#25579)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …and other misc. display-related updates Co-authored-by: Scott Lahteine --- Marlin/src/HAL/STM32/tft/tft_spi.cpp | 1 - Marlin/src/HAL/STM32F1/tft/tft_spi.cpp | 15 +++--- Marlin/src/inc/Conditionals_LCD.h | 41 ++++++--------- Marlin/src/inc/Conditionals_post.h | 21 +++++++- .../dogm/u8g_dev_tft_upscale_from_128x64.cpp | 2 +- .../src/lcd/extui/mks_ui/draw_print_file.cpp | 50 +++++-------------- Marlin/src/lcd/extui/mks_ui/draw_ui.h | 32 ++++++------ .../extui/mks_ui/tft_lvgl_configuration.cpp | 3 +- .../lcd/extui/mks_ui/tft_lvgl_configuration.h | 2 - Marlin/src/lcd/extui/mks_ui/wifi_module.cpp | 1 + Marlin/src/lcd/tft/touch.cpp | 7 ++- Marlin/src/lcd/tft_io/ili9488.h | 10 ---- Marlin/src/lcd/tft_io/tft_io.h | 2 - Marlin/src/lcd/tft_io/tft_orientation.h | 16 ------ Marlin/src/lcd/tft_io/touch_calibration.h | 4 +- Marlin/src/lcd/touch/touch_buttons.cpp | 2 +- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 2 +- 17 files changed, 80 insertions(+), 131 deletions(-) diff --git a/Marlin/src/HAL/STM32/tft/tft_spi.cpp b/Marlin/src/HAL/STM32/tft/tft_spi.cpp index 6ee4dc3364..dbb93c786b 100644 --- a/Marlin/src/HAL/STM32/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32/tft/tft_spi.cpp @@ -245,7 +245,6 @@ void TFT_SPI::TransmitDMA(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Coun TERN_(TFT_SHARED_IO, while (isBusy())); } - void TFT_SPI::Transmit(uint32_t MemoryIncrease, uint16_t *Data, uint16_t Count) { DMAtx.Init.MemInc = MemoryIncrease; HAL_DMA_Init(&DMAtx); diff --git a/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp b/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp index eed52f4e8a..5264aabef6 100644 --- a/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp +++ b/Marlin/src/HAL/STM32F1/tft/tft_spi.cpp @@ -94,25 +94,24 @@ uint32_t TFT_SPI::GetID() { } uint32_t TFT_SPI::ReadID(uint16_t Reg) { - #if !PIN_EXISTS(TFT_MISO) - return 0; - #else - uint8_t d = 0; - uint32_t data = 0; + uint32_t data = 0; + + #if PIN_EXISTS(TFT_MISO) SPIx.setClockDivider(SPI_CLOCK_DIV16); DataTransferBegin(DATASIZE_8BIT); WriteReg(Reg); LOOP_L_N(i, 4) { - SPIx.read((uint8_t*)&d, 1); + uint8_t d; + SPIx.read(&d, 1); data = (data << 8) | d; } DataTransferEnd(); SPIx.setClockDivider(SPI_CLOCK_MAX); - - return data >> 7; #endif + + return data >> 7; } bool TFT_SPI::isBusy() { diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index c28a49c8df..44072ef4a2 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -328,24 +328,22 @@ #define IS_ULTIPANEL 1 #endif -// TFT Legacy Compatibility +// TFT Legacy options masquerade as TFT_GENERIC #if ANY(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI) #define IS_LEGACY_TFT 1 #define TFT_GENERIC -#endif - -#if ANY(FSMC_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_LVGL_UI_FSMC) - #define TFT_INTERFACE_FSMC -#elif ANY(SPI_GRAPHICAL_TFT, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_SPI) - #define TFT_INTERFACE_SPI -#endif - -#if EITHER(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT) - #define TFT_CLASSIC_UI -#elif ANY(TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI) - #define TFT_COLOR_UI -#elif EITHER(TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI) - #define TFT_LVGL_UI + #if ANY(FSMC_GRAPHICAL_TFT, TFT_320x240, TFT_480x320, TFT_LVGL_UI_FSMC) + #define TFT_INTERFACE_FSMC + #elif ANY(SPI_GRAPHICAL_TFT, TFT_320x240_SPI, TFT_480x320_SPI, TFT_LVGL_UI_SPI) + #define TFT_INTERFACE_SPI + #endif + #if EITHER(FSMC_GRAPHICAL_TFT, SPI_GRAPHICAL_TFT) + #define TFT_CLASSIC_UI + #elif ANY(TFT_320x240, TFT_480x320, TFT_320x240_SPI, TFT_480x320_SPI) + #define TFT_COLOR_UI + #elif EITHER(TFT_LVGL_UI_FSMC, TFT_LVGL_UI_SPI) + #define TFT_LVGL_UI + #endif #endif // FSMC/SPI TFT Panels (LVGL) @@ -1671,7 +1669,7 @@ #endif #if ANY(HAS_SPI_TFT, HAS_FSMC_TFT, HAS_LTDC_TFT) - #include "../lcd/tft_io/tft_orientation.h" + #include "../lcd/tft_io/tft_orientation.h" // for TFT_COLOR_UI_PORTRAIT #endif #if ENABLED(TFT_RES_320x240) @@ -1775,17 +1773,6 @@ #endif #endif -// XPT2046_** Compatibility -#if !(defined(TOUCH_CALIBRATION_X) || defined(TOUCH_CALIBRATION_Y) || defined(TOUCH_OFFSET_X) || defined(TOUCH_OFFSET_Y) || defined(TOUCH_ORIENTATION)) - #if defined(XPT2046_X_CALIBRATION) && defined(XPT2046_Y_CALIBRATION) && defined(XPT2046_X_OFFSET) && defined(XPT2046_Y_OFFSET) - #define TOUCH_CALIBRATION_X XPT2046_X_CALIBRATION - #define TOUCH_CALIBRATION_Y XPT2046_Y_CALIBRATION - #define TOUCH_OFFSET_X XPT2046_X_OFFSET - #define TOUCH_OFFSET_Y XPT2046_Y_OFFSET - #define TOUCH_ORIENTATION TOUCH_LANDSCAPE - #endif -#endif - #if X_HOME_DIR || (HAS_Y_AXIS && Y_HOME_DIR) || (HAS_Z_AXIS && Z_HOME_DIR) \ || (HAS_I_AXIS && I_HOME_DIR) || (HAS_J_AXIS && J_HOME_DIR) || (HAS_K_AXIS && K_HOME_DIR) \ || (HAS_U_AXIS && U_HOME_DIR) || (HAS_V_AXIS && V_HOME_DIR) || (HAS_W_AXIS && W_HOME_DIR) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 0d74649009..7319905ee6 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -560,7 +560,7 @@ #define REINIT_NOISY_LCD 1 // Have the LCD re-init on SD insertion #endif -#endif +#endif // HAS_MEDIA /** * Power Supply @@ -3153,6 +3153,25 @@ #endif #endif +// Touch Calibration +#if ANY(HAS_SPI_TFT, HAS_FSMC_TFT, HAS_LTDC_TFT) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 0 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 0 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 0 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 0 + #endif + #ifndef TOUCH_ORIENTATION + #define TOUCH_ORIENTATION TOUCH_LANDSCAPE + #endif +#endif + // Number of VFAT entries used. Each entry has 13 UTF-16 characters #if ANY(SCROLL_LONG_FILENAMES, HAS_DWIN_E3V2, TFT_COLOR_UI) #define VFAT_ENTRIES_LIMIT 5 diff --git a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp index efc010ca89..e51767f96a 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp @@ -556,4 +556,4 @@ U8G_PB_DEV(u8g_dev_tft_320x240_upscale_from_128x64, WIDTH, HEIGHT, PAGE_HEIGHT, #endif // TOUCH_SCREEN_CALIBRATION -#endif // HAS_MARLINUI_U8GLIB && (FSMC_CS_PIN || HAS_SPI_GRAPHICAL_TFT) +#endif // HAS_MARLINUI_U8GLIB && (FSMC_CS_PIN || HAS_SPI_GRAPHICAL_TFT || HAS_LTDC_GRAPHICAL_TFT) diff --git a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp index 4997641e15..da79cb6174 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_print_file.cpp @@ -120,8 +120,6 @@ bool have_pre_pic(char *path) { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; uint8_t i, file_count = 0; - //switch (obj->mks_obj_id) - //{ if (obj->mks_obj_id == ID_P_UP) { if (dir_offset[curDirLever].curPage > 0) { // 2015.05.19 @@ -130,9 +128,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { if (dir_offset[curDirLever].cur_page_first_offset >= FILE_NUM) list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset - FILE_NUM; - #if HAS_MEDIA - file_count = search_file(); - #endif + TERN_(HAS_MEDIA, file_count = search_file()); if (file_count != 0) { dir_offset[curDirLever].curPage--; lv_clear_print_file(); @@ -144,9 +140,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { if (dir_offset[curDirLever].cur_page_last_offset > 0) { list_file.Sd_file_cnt = 0; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_last_offset + 1; - #if HAS_MEDIA - file_count = search_file(); - #endif + TERN_(HAS_MEDIA, file_count = search_file()); if (file_count != 0) { dir_offset[curDirLever].curPage++; lv_clear_print_file(); @@ -161,17 +155,13 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { int8_t *ch = (int8_t *)strrchr(list_file.curDirPath, '/'); if (ch) { *ch = 0; - #if HAS_MEDIA - card.cdup(); - #endif + TERN_(HAS_MEDIA, card.cdup()); dir_offset[curDirLever].curPage = 0; dir_offset[curDirLever].cur_page_first_offset = 0; dir_offset[curDirLever].cur_page_last_offset = 0; curDirLever--; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if HAS_MEDIA - file_count = search_file(); - #endif + TERN_(HAS_MEDIA, file_count = search_file()); lv_clear_print_file(); disp_gcode_icon(file_count); } @@ -189,9 +179,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { strcpy(list_file.curDirPath, list_file.file_name[i]); curDirLever++; list_file.Sd_file_offset = dir_offset[curDirLever].cur_page_first_offset; - #if HAS_MEDIA - file_count = search_file(); - #endif + TERN_(HAS_MEDIA, file_count = search_file()); lv_clear_print_file(); disp_gcode_icon(file_count); } @@ -396,8 +384,7 @@ int ascii2dec_test(char *ascii) { void lv_gcode_file_read(uint8_t *data_buf) { #if HAS_MEDIA - uint16_t i = 0, j = 0, k = 0; - uint16_t row_1 = 0; + uint16_t i = 0, j = 0, k = 0, row_1 = 0; bool ignore_start = true; char temp_test[200]; volatile uint16_t *p_index; @@ -435,24 +422,13 @@ void lv_gcode_file_read(uint8_t *data_buf) { break; } } - #if HAS_TFT_LVGL_UI_SPI - for (i = 0; i < 200;) { - p_index = (uint16_t *)(&public_buf[i]); - - //Color = (*p_index >> 8); - //*p_index = Color | ((*p_index & 0xFF) << 8); - i += 2; - if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; - } - #else // !HAS_TFT_LVGL_UI_SPI - for (i = 0; i < 200;) { - p_index = (uint16_t *)(&public_buf[i]); - //Color = (*p_index >> 8); - //*p_index = Color | ((*p_index & 0xFF) << 8); - i += 2; - if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; // 0x18C3; - } - #endif // !HAS_TFT_LVGL_UI_SPI + for (i = 0; i < 200;) { + p_index = (uint16_t *)(&public_buf[i]); + //Color = (*p_index >> 8); + //*p_index = Color | ((*p_index & 0xFF) << 8); + i += 2; + if (*p_index == 0x0000) *p_index = LV_COLOR_BACKGROUND.full; + } memcpy(data_buf, public_buf, 200); #endif // HAS_MEDIA } diff --git a/Marlin/src/lcd/extui/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/mks_ui/draw_ui.h index 9bc583d3ad..da43f2a490 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/mks_ui/draw_ui.h @@ -133,16 +133,16 @@ #define FILE_PRE_PIC_Y_OFFSET 0 #define PREVIEW_LITTLE_PIC_SIZE 40910 // 400*100+9*101+1 - #define PREVIEW_SIZE 202720 // (PREVIEW_LITTLE_PIC_SIZE+800*200+201*9+1) + #define PREVIEW_SIZE 202720 // (PREVIEW_LITTLE_PIC_SIZE+800*200+201*9+1) // machine parameter ui - #define PARA_UI_POS_X 10 - #define PARA_UI_POS_Y 50 + #define PARA_UI_POS_X 10 + #define PARA_UI_POS_Y 50 #define PARA_UI_SIZE_X 450 - #define PARA_UI_SIZE_Y 40 + #define PARA_UI_SIZE_Y 40 - #define PARA_UI_ARROW_V 12 + #define PARA_UI_ARROW_V 12 #define PARA_UI_BACK_POS_X 400 #define PARA_UI_BACK_POS_Y 270 @@ -152,31 +152,31 @@ #define PARA_UI_VALUE_SIZE_X 370 #define PARA_UI_VALUE_POS_X 400 - #define PARA_UI_VALUE_V 5 + #define PARA_UI_VALUE_V 5 #define PARA_UI_STATE_POS_X 380 - #define PARA_UI_STATE_V 2 + #define PARA_UI_STATE_V 2 #define PARA_UI_VALUE_SIZE_X_2 200 #define PARA_UI_VALUE_POS_X_2 320 - #define PARA_UI_VALUE_V_2 5 + #define PARA_UI_VALUE_V_2 5 - #define PARA_UI_VALUE_BTN_X_SIZE 70 - #define PARA_UI_VALUE_BTN_Y_SIZE 28 + #define PARA_UI_VALUE_BTN_X_SIZE 70 + #define PARA_UI_VALUE_BTN_Y_SIZE 28 - #define PARA_UI_BACK_BTN_X_SIZE 70 - #define PARA_UI_BACK_BTN_Y_SIZE 40 + #define PARA_UI_BACK_BTN_X_SIZE 70 + #define PARA_UI_BACK_BTN_Y_SIZE 40 - #define QRCODE_X 20 - #define QRCODE_Y 40 + #define QRCODE_X 20 + #define QRCODE_Y 40 #define QRCODE_WIDTH 160 -#else // ifdef TFT35 +#else // !TFT35 #define TFT_WIDTH 320 #define TFT_HEIGHT 240 -#endif // ifdef TFT35 +#endif #ifdef __cplusplus extern "C" { diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp index 991754ba96..94c3517e3a 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp @@ -36,10 +36,11 @@ #include #include "../../../MarlinCore.h" +#include "../../marlinui.h" + #include "../../../inc/MarlinConfig.h" #include HAL_PATH(../../.., tft/xpt2046.h) -#include "../../marlinui.h" XPT2046 touch; #if ENABLED(POWER_LOSS_RECOVERY) diff --git a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h index 0368140b28..a71bdc9db7 100644 --- a/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h +++ b/Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.h @@ -32,8 +32,6 @@ #include -//#define TFT_ROTATION TFT_ROTATE_180 - extern uint8_t bmp_public_buf[14 * 1024]; extern uint8_t public_buf[513]; diff --git a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp index cf2411ee7e..bf399f70aa 100644 --- a/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp +++ b/Marlin/src/lcd/extui/mks_ui/wifi_module.cpp @@ -1804,6 +1804,7 @@ void stopEspTransfer() { W25QXX.init(SPI_QUARTER_SPEED); + // ?? Workaround for SPI / Servo issues ?? TERN_(HAS_TFT_LVGL_UI_SPI, SPI_TFT.spi_init(SPI_FULL_SPEED)); TERN_(HAS_SERVOS, servo_init()); TERN_(HAS_Z_SERVO_PROBE, probe.servo_probe_init()); diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 9482c85a47..17784ff527 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -266,19 +266,18 @@ void Touch::hold(touch_control_t *control, millis_t delay) { bool Touch::get_point(int16_t *x, int16_t *y) { #if ENABLED(TFT_TOUCH_DEVICE_XPT2046) #if ENABLED(TOUCH_SCREEN_CALIBRATION) - bool is_touched = (touch_calibration.calibration.orientation == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y)); - + const bool is_touched = (touch_calibration.calibration.orientation == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y)); if (is_touched && touch_calibration.calibration.orientation != TOUCH_ORIENTATION_NONE) { *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 - bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y)); + const bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? io.getRawPoint(y, x) : io.getRawPoint(x, y)); *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 #elif ENABLED(TFT_TOUCH_DEVICE_GT911) - bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? io.getPoint(y, x) : io.getPoint(x, y)); + const bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? io.getPoint(y, x) : io.getPoint(x, y)); #endif #if HAS_TOUCH_SLEEP if (is_touched) diff --git a/Marlin/src/lcd/tft_io/ili9488.h b/Marlin/src/lcd/tft_io/ili9488.h index fc2add662d..f28d411bbd 100644 --- a/Marlin/src/lcd/tft_io/ili9488.h +++ b/Marlin/src/lcd/tft_io/ili9488.h @@ -146,16 +146,6 @@ #define ILI9488_ADJCTL6 0xFC // Adjust Control 6 #define ILI9488_ADJCTL7 0xFF // Adjust Control 7 -#if 0 - // https://forum.mikroe.com/viewtopic.php?t=74586 - #if ANY(MKS_ROBIN_TFT35, TFT_TRONXY_X5SA, ANYCUBIC_TFT35) // ILI9488 - #define TFT_DRIVER ILI9488 - #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) - #define TFT_RES_480x320 - #define TFT_INTERFACE_FSMC - #endif -#endif - static const uint16_t ili9488_init[] = { DATASIZE_8BIT, ESC_REG(ILI9488_SWRESET), ESC_DELAY(120), diff --git a/Marlin/src/lcd/tft_io/tft_io.h b/Marlin/src/lcd/tft_io/tft_io.h index 226348552d..673bb07d5f 100644 --- a/Marlin/src/lcd/tft_io/tft_io.h +++ b/Marlin/src/lcd/tft_io/tft_io.h @@ -37,8 +37,6 @@ #error "DMA_MAX_SIZE is not configured for this platform." #endif -#include "tft_orientation.h" - #ifndef TFT_DRIVER #define TFT_DRIVER AUTO #endif diff --git a/Marlin/src/lcd/tft_io/tft_orientation.h b/Marlin/src/lcd/tft_io/tft_orientation.h index c2c86435b2..99c6a13c64 100644 --- a/Marlin/src/lcd/tft_io/tft_orientation.h +++ b/Marlin/src/lcd/tft_io/tft_orientation.h @@ -66,19 +66,3 @@ #define TOUCH_ORIENTATION_NONE 0 #define TOUCH_LANDSCAPE 1 #define TOUCH_PORTRAIT 2 - -#ifndef TOUCH_CALIBRATION_X - #define TOUCH_CALIBRATION_X 0 -#endif -#ifndef TOUCH_CALIBRATION_Y - #define TOUCH_CALIBRATION_Y 0 -#endif -#ifndef TOUCH_OFFSET_X - #define TOUCH_OFFSET_X 0 -#endif -#ifndef TOUCH_OFFSET_Y - #define TOUCH_OFFSET_Y 0 -#endif -#ifndef TOUCH_ORIENTATION - #define TOUCH_ORIENTATION TOUCH_LANDSCAPE -#endif diff --git a/Marlin/src/lcd/tft_io/touch_calibration.h b/Marlin/src/lcd/tft_io/touch_calibration.h index 030b4977db..e9d3110c56 100644 --- a/Marlin/src/lcd/tft_io/touch_calibration.h +++ b/Marlin/src/lcd/tft_io/touch_calibration.h @@ -21,13 +21,11 @@ */ #pragma once -#include "../../inc/MarlinConfigPre.h" -#include "tft_io.h" +#include "../../inc/MarlinConfig.h" #ifndef TOUCH_SCREEN_CALIBRATION_PRECISION #define TOUCH_SCREEN_CALIBRATION_PRECISION 80 #endif - #ifndef TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS #define TOUCH_SCREEN_HOLD_TO_CALIBRATE_MS 2500 #endif diff --git a/Marlin/src/lcd/touch/touch_buttons.cpp b/Marlin/src/lcd/touch/touch_buttons.cpp index 032015cdd0..2e996f30ce 100644 --- a/Marlin/src/lcd/touch/touch_buttons.cpp +++ b/Marlin/src/lcd/touch/touch_buttons.cpp @@ -65,7 +65,7 @@ void TouchButtons::init() { } uint8_t TouchButtons::read_buttons() { - #ifdef HAS_WIRED_LCD + #if HAS_WIRED_LCD int16_t x, y; #if ENABLED(TFT_TOUCH_DEVICE_XPT2046) diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index b414c0015f..e322af8fec 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -408,7 +408,7 @@ #ifndef TFT_DRIVER #define TFT_DRIVER ST7796 #endif - #ifndef TOUCH_SCREEN_CALIBRATION + #if DISABLED(TOUCH_SCREEN_CALIBRATION) #if ENABLED(TFT_RES_320x240) #ifndef TOUCH_CALIBRATION_X #define TOUCH_CALIBRATION_X 20525