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 }