From 0cfbb0f49cb7011ededc5dfe16de6a560b8529a3 Mon Sep 17 00:00:00 2001 From: Julio Date: Thu, 2 Nov 2023 19:25:57 +0100 Subject: [PATCH 1/2] fix #210 implement Switch off screen on Lilygo dongle --- platformio.ini | 2 ++ src/drivers/displays/dongleDisplayDriver.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/platformio.ini b/platformio.ini index 9fe7297..14160df 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,6 +126,8 @@ build_flags = -DNERMINER_S3_DONGLE -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT + -DTFT_BACKLIGHT_ON=HIGH + -DTFT_BL=38 lib_deps = https://github.com/takkaO/OpenFontRender bblanchon/ArduinoJson@^6.21.2 diff --git a/src/drivers/displays/dongleDisplayDriver.cpp b/src/drivers/displays/dongleDisplayDriver.cpp index 28d45f4..ca29fca 100644 --- a/src/drivers/displays/dongleDisplayDriver.cpp +++ b/src/drivers/displays/dongleDisplayDriver.cpp @@ -103,6 +103,9 @@ void dongleDisplay_Init(void) void dongleDisplay_AlternateScreenState(void) { + int screen_state = digitalRead(TFT_BL); + Serial.println("Switching display state"); + digitalWrite(TFT_BL, !screen_state); } void dongleDisplay_AlternateRotation(void) From 2f34d5fa684eac16a177b15d3965f373f403bf8b Mon Sep 17 00:00:00 2001 From: Julio MATARRANZ Date: Thu, 9 Nov 2023 14:14:27 +0100 Subject: [PATCH 2/2] fix : switch backlight to LOW to start with screen on --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 14160df..d7fb52d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ build_flags = -DNERMINER_S3_DONGLE -DBOARD_HAS_PSRAM -DARDUINO_USB_CDC_ON_BOOT - -DTFT_BACKLIGHT_ON=HIGH + -DTFT_BACKLIGHT_ON=LOW -DTFT_BL=38 lib_deps = https://github.com/takkaO/OpenFontRender