minor companion ui fixes

This commit is contained in:
JQ
2025-06-07 15:57:22 -07:00
parent af0c409cbb
commit 1bc94c2ec3

View File

@@ -5,7 +5,7 @@
#include "MyMesh.h" #include "MyMesh.h"
#define AUTO_OFF_MILLIS 15000 // 15 seconds #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 #ifdef PIN_STATUS_LED
#define LED_ON_MILLIS 20 #define LED_ON_MILLIS 20
@@ -191,7 +191,7 @@ void UITask::renderCurrScreen() {
sprintf(tmp, "%d", _msgcount); sprintf(tmp, "%d", _msgcount);
_display->print(tmp); _display->print(tmp);
_display->setColor(DisplayDriver::YELLOW); // last color will be kept on T114 _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 // meshcore logo
_display->setColor(DisplayDriver::BLUE); _display->setColor(DisplayDriver::BLUE);
int logoWidth = 128; int logoWidth = 128;
@@ -302,7 +302,7 @@ void UITask::loop() {
if (_display != NULL && _display->isOn()) { if (_display != NULL && _display->isOn()) {
static bool _firstBoot = true; static bool _firstBoot = true;
if(_firstBoot && millis() >= BOOT_SCREEN_MILLIS) { if(_firstBoot && (millis() - ui_started_at) >= BOOT_SCREEN_MILLIS) {
_need_refresh = true; _need_refresh = true;
_firstBoot = false; _firstBoot = false;
} }
@@ -344,6 +344,8 @@ void UITask::handleButtonShortPress() {
// Otherwise, refresh the display // Otherwise, refresh the display
_need_refresh = true; _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 // Note: Display turn-on and auto-off timer extension are handled by handleButtonAnyPress
} }
@@ -372,10 +374,13 @@ void UITask::handleButtonTriplePress() {
if (buzzer.isQuiet()) { if (buzzer.isQuiet()) {
buzzer.quiet(false); buzzer.quiet(false);
soundBuzzer(UIEventType::ack); soundBuzzer(UIEventType::ack);
sprintf(_alert, "Quiet mode: OFF");
} else { } else {
soundBuzzer(UIEventType::ack); soundBuzzer(UIEventType::ack);
buzzer.quiet(true); buzzer.quiet(true);
sprintf(_alert, "Quiet mode: ON");
} }
_need_refresh = true;
#endif #endif
} }