From 1bc94c2ec3cead325993798a90a1351e4d237a65 Mon Sep 17 00:00:00 2001 From: JQ Date: Sat, 7 Jun 2025 15:57:22 -0700 Subject: [PATCH 1/3] minor companion ui fixes --- examples/companion_radio/UITask.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/companion_radio/UITask.cpp b/examples/companion_radio/UITask.cpp index deeacdad..79dde2d8 100644 --- a/examples/companion_radio/UITask.cpp +++ b/examples/companion_radio/UITask.cpp @@ -5,7 +5,7 @@ #include "MyMesh.h" #define AUTO_OFF_MILLIS 15000 // 15 seconds -#define BOOT_SCREEN_MILLIS 4000 // 4 seconds +#define BOOT_SCREEN_MILLIS 3000 // 3 seconds #ifdef PIN_STATUS_LED #define LED_ON_MILLIS 20 @@ -191,7 +191,7 @@ void UITask::renderCurrScreen() { sprintf(tmp, "%d", _msgcount); _display->print(tmp); _display->setColor(DisplayDriver::YELLOW); // last color will be kept on T114 - } else if (millis() < BOOT_SCREEN_MILLIS) { // boot screen + } else if ((millis() - ui_started_at) < BOOT_SCREEN_MILLIS) { // boot screen // meshcore logo _display->setColor(DisplayDriver::BLUE); int logoWidth = 128; @@ -302,7 +302,7 @@ void UITask::loop() { if (_display != NULL && _display->isOn()) { static bool _firstBoot = true; - if(_firstBoot && millis() >= BOOT_SCREEN_MILLIS) { + if(_firstBoot && (millis() - ui_started_at) >= BOOT_SCREEN_MILLIS) { _need_refresh = true; _firstBoot = false; } @@ -344,6 +344,8 @@ void UITask::handleButtonShortPress() { // Otherwise, refresh the display _need_refresh = true; } + } else { + _need_refresh = true; // display just turned on, so we need to refresh } // Note: Display turn-on and auto-off timer extension are handled by handleButtonAnyPress } @@ -372,10 +374,13 @@ void UITask::handleButtonTriplePress() { if (buzzer.isQuiet()) { buzzer.quiet(false); soundBuzzer(UIEventType::ack); + sprintf(_alert, "Quiet mode: OFF"); } else { soundBuzzer(UIEventType::ack); buzzer.quiet(true); + sprintf(_alert, "Quiet mode: ON"); } + _need_refresh = true; #endif } From 42ef297241a539be366da3f989ff7dfc0c021b42 Mon Sep 17 00:00:00 2001 From: JQ Date: Sat, 7 Jun 2025 22:35:59 -0700 Subject: [PATCH 2/3] set text width ahead of width calculation --- examples/companion_radio/UITask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/companion_radio/UITask.cpp b/examples/companion_radio/UITask.cpp index 79dde2d8..3801236b 100644 --- a/examples/companion_radio/UITask.cpp +++ b/examples/companion_radio/UITask.cpp @@ -163,9 +163,9 @@ void UITask::renderCurrScreen() { char tmp[80]; if (_alert[0]) { + _display->setTextSize(1.4); uint16_t textWidth = _display->getTextWidth(_alert); _display->setCursor((_display->width() - textWidth) / 2, 22); - _display->setTextSize(1.4); _display->setColor(DisplayDriver::GREEN); _display->print(_alert); _alert[0] = 0; From 7c011324f245c87563deed8f7e14977d73908a71 Mon Sep 17 00:00:00 2001 From: JQ Date: Sun, 8 Jun 2025 08:25:54 -0700 Subject: [PATCH 3/3] feedback --- examples/companion_radio/UITask.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/companion_radio/UITask.cpp b/examples/companion_radio/UITask.cpp index 3801236b..01906f90 100644 --- a/examples/companion_radio/UITask.cpp +++ b/examples/companion_radio/UITask.cpp @@ -374,11 +374,10 @@ void UITask::handleButtonTriplePress() { if (buzzer.isQuiet()) { buzzer.quiet(false); soundBuzzer(UIEventType::ack); - sprintf(_alert, "Quiet mode: OFF"); + sprintf(_alert, "Buzzer: ON"); } else { - soundBuzzer(UIEventType::ack); buzzer.quiet(true); - sprintf(_alert, "Quiet mode: ON"); + sprintf(_alert, "Buzzer: OFF"); } _need_refresh = true; #endif