From 1e711f57f49f8daaedc3c041f37411d4bf07528c Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 8 Aug 2025 15:34:58 +0200 Subject: [PATCH] techo: initial support of new companion ui --- src/helpers/ui/GxEPDDisplay.cpp | 6 +++--- variants/techo/platformio.ini | 1 + variants/techo/target.cpp | 1 + variants/techo/target.h | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/helpers/ui/GxEPDDisplay.cpp b/src/helpers/ui/GxEPDDisplay.cpp index 50df9d10..8a138c6c 100644 --- a/src/helpers/ui/GxEPDDisplay.cpp +++ b/src/helpers/ui/GxEPDDisplay.cpp @@ -68,10 +68,10 @@ void GxEPDDisplay::setTextSize(int sz) { } void GxEPDDisplay::setColor(Color c) { - if (c == DARK) { - display.setTextColor(_curr_color = GxEPD_BLACK); - } else { + if (c == DARK) { // invert colors for epds display.setTextColor(_curr_color = GxEPD_WHITE); + } else { + display.setTextColor(_curr_color = GxEPD_BLACK); } } diff --git a/variants/techo/platformio.ini b/variants/techo/platformio.ini index 8ad5ca03..45eba9fc 100644 --- a/variants/techo/platformio.ini +++ b/variants/techo/platformio.ini @@ -73,6 +73,7 @@ build_src_filter = ${LilyGo_Techo.build_src_filter} + + + + + +<../examples/companion_radio> lib_deps = ${LilyGo_Techo.lib_deps} diff --git a/variants/techo/target.cpp b/variants/techo/target.cpp index 1e413531..9a10491d 100644 --- a/variants/techo/target.cpp +++ b/variants/techo/target.cpp @@ -16,6 +16,7 @@ TechoSensorManager sensors = TechoSensorManager(nmea); #ifdef DISPLAY_CLASS DISPLAY_CLASS display; + MomentaryButton user_btn(PIN_USER_BTN, 1000, true); #endif bool radio_init() { diff --git a/variants/techo/target.h b/variants/techo/target.h index 7c05e742..58fba687 100644 --- a/variants/techo/target.h +++ b/variants/techo/target.h @@ -10,6 +10,7 @@ #include #ifdef DISPLAY_CLASS #include + #include #endif class TechoSensorManager : public SensorManager { @@ -36,6 +37,7 @@ extern TechoSensorManager sensors; #ifdef DISPLAY_CLASS extern DISPLAY_CLASS display; + extern MomentaryButton user_btn; #endif bool radio_init();