From e40200373ebbd847e2e73d217c4938cebd9fe4e9 Mon Sep 17 00:00:00 2001 From: Victor Mateus Oliveira Date: Mon, 12 Oct 2020 22:44:37 -0300 Subject: [PATCH 1/3] fix warning --- Marlin/src/lcd/tft_io/ili9328.h | 8 +++++--- Marlin/src/lcd/tft_io/r65105.h | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/tft_io/ili9328.h b/Marlin/src/lcd/tft_io/ili9328.h index 818dd05b348f..b50517adfea5 100644 --- a/Marlin/src/lcd/tft_io/ili9328.h +++ b/Marlin/src/lcd/tft_io/ili9328.h @@ -49,9 +49,11 @@ #define ILI9328_GATE_SCANCTL1_DATA 0x2700 #endif -// #define ILI9328_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ILI9328_ETMOD_AM) | \ -// IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ILI9328_ETMOD_ID1) | \ -// IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ILI9328_ETMOD_ID0) +/* +#define ILI9328_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, ILI9328_ETMOD_AM) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, ILI9328_ETMOD_ID1) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, ILI9328_ETMOD_ID0) +*/ #define ILI9328_ETMOD_ORIENTATION (ILI9328_ETMOD_AM | ILI9328_ETMOD_ID1 | ILI9328_ETMOD_ID0) diff --git a/Marlin/src/lcd/tft_io/r65105.h b/Marlin/src/lcd/tft_io/r65105.h index a813c3260b1a..8be2afe4423c 100644 --- a/Marlin/src/lcd/tft_io/r65105.h +++ b/Marlin/src/lcd/tft_io/r65105.h @@ -51,9 +51,11 @@ #define R61505_DRVCTRL_DATA 0x2700 #endif -// #define R61505_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, R61505_ETMOD_AM) | \ -// IF_0((TFT_ORIENTATION) & TFT_INVERT_X, R61505_ETMOD_ID0) | \ -// IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, R61505_ETMOD_ID1) +/* +#define R61505_ETMOD_ORIENTATION IF_0((TFT_ORIENTATION) & TFT_EXCHANGE_XY, R61505_ETMOD_AM) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_X, R61505_ETMOD_ID0) | \ + IF_0((TFT_ORIENTATION) & TFT_INVERT_Y, R61505_ETMOD_ID1) +*/ #define R61505_ETMOD_ORIENTATION (R61505_ETMOD_AM | R61505_ETMOD_ID0 | R61505_ETMOD_ID1) From 4cec1fb15f2a14433fa63c1c03ad1079b5e926af Mon Sep 17 00:00:00 2001 From: Victor Mateus Oliveira Date: Tue, 13 Oct 2020 13:11:04 -0300 Subject: [PATCH 2/3] fix var assigment --- Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ecd4eb482a6a..ccb6a8e4dcf1 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 @@ -474,7 +474,8 @@ void lv_encoder_pin_init() { #endif - static uint8_t buttons = newbutton; + static uint8_t buttons = 0; + buttons = newbutton; static uint8_t lastEncoderBits; #define encrot0 0 From 876b40a30116c6f3ea522ed640feac42c6021e7f Mon Sep 17 00:00:00 2001 From: Victor Mateus Oliveira Date: Tue, 13 Oct 2020 13:14:55 -0300 Subject: [PATCH 3/3] this screen have M995, so dont need handle 180 there --- Marlin/src/lcd/tft/touch.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Marlin/src/lcd/tft/touch.cpp b/Marlin/src/lcd/tft/touch.cpp index 2124a42e28ca..80c65f074ae6 100644 --- a/Marlin/src/lcd/tft/touch.cpp +++ b/Marlin/src/lcd/tft/touch.cpp @@ -295,10 +295,6 @@ bool Touch::get_point(int16_t *x, int16_t *y) { if (is_touched && calibration.orientation != TOUCH_ORIENTATION_NONE) { *x = int16_t((int32_t(*x) * calibration.x) >> 16) + calibration.offset_x; *y = int16_t((int32_t(*y) * calibration.y) >> 16) + calibration.offset_y; - #if (TFT_ROTATION & TFT_ROTATE_180) - *x = TFT_WIDTH - *x; - *y = TFT_HEIGHT - *y; - #endif } return is_touched; }