From e37a23231aa6ebe5520b42f54720b76f7414c56a Mon Sep 17 00:00:00 2001 From: mjbogusz Date: Sat, 15 Oct 2022 01:59:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20TFT=20LCD=20in=20Simulatio?= =?UTF-8?q?n=20(#24871)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 4 ++-- Marlin/src/inc/Conditionals_LCD.h | 6 ++++-- Marlin/src/lcd/marlinui.cpp | 2 +- Marlin/src/pins/linux/pins_RAMPS_LINUX.h | 13 +++++++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ebcdf25e2d..d0495dc7d8 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ tests-single-ci: tests-single-local: @if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET= or use make tests-all-local" ; return 1; fi - export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \ + export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && run_tests . $(TEST_TARGET) "$(ONLY_TEST)" .PHONY: tests-single-local @@ -38,7 +38,7 @@ tests-single-local-docker: .PHONY: tests-single-local-docker tests-all-local: - export PATH=./buildroot/bin/:./buildroot/tests/:${PATH} \ + export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \ && export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \ && for TEST_TARGET in $$(./get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done .PHONY: tests-all-local diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 47ae0a6dff..7f6857a3e0 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1496,7 +1496,7 @@ #endif #elif ENABLED(TFT_GENERIC) #define TFT_DEFAULT_ORIENTATION (TFT_EXCHANGE_XY | TFT_INVERT_X | TFT_INVERT_Y) - #if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320) + #if NONE(TFT_RES_320x240, TFT_RES_480x272, TFT_RES_480x320, TFT_RES_1024x600) #define TFT_RES_320x240 #endif #if NONE(TFT_INTERFACE_FSMC, TFT_INTERFACE_SPI) @@ -1574,6 +1574,8 @@ #elif TFT_HEIGHT == 600 #if ENABLED(TFT_INTERFACE_LTDC) #define TFT_1024x600_LTDC + #else + #define TFT_1024x600_SIM // "Simulation" - for testing purposes only #endif #endif #endif @@ -1584,7 +1586,7 @@ #define HAS_UI_480x320 1 #elif EITHER(TFT_480x272, TFT_480x272_SPI) #define HAS_UI_480x272 1 -#elif defined(TFT_1024x600_LTDC) +#elif EITHER(TFT_1024x600_LTDC, TFT_1024x600_SIM) #define HAS_UI_1024x600 1 #endif #if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272) diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index 00b0d62e1a..2e116d5479 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -1726,7 +1726,7 @@ void MarlinUI::init() { ); } - #if LCD_WITH_BLINK + #if LCD_WITH_BLINK && DISABLED(HAS_GRAPHICAL_TFT) typedef void (*PrintProgress_t)(); void MarlinUI::rotate_progress() { // Renew and redraw all enabled progress strings const PrintProgress_t progFunc[] = { diff --git a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h index 9e2eedd68e..75d6b9d93e 100644 --- a/Marlin/src/pins/linux/pins_RAMPS_LINUX.h +++ b/Marlin/src/pins/linux/pins_RAMPS_LINUX.h @@ -450,6 +450,19 @@ #ifndef TOUCH_OFFSET_Y #define TOUCH_OFFSET_Y 1 #endif + #elif ENABLED(TFT_RES_1024x600) + #ifndef TOUCH_CALIBRATION_X + #define TOUCH_CALIBRATION_X 65533 + #endif + #ifndef TOUCH_CALIBRATION_Y + #define TOUCH_CALIBRATION_Y 38399 + #endif + #ifndef TOUCH_OFFSET_X + #define TOUCH_OFFSET_X 2 + #endif + #ifndef TOUCH_OFFSET_Y + #define TOUCH_OFFSET_Y 1 + #endif #endif #endif