From 8efff38a4f62e04a809cc73d6830a9eeeb6b93e7 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Thu, 14 May 2026 17:25:27 +0200 Subject: [PATCH] fix: auto-advert indicator - capital A with space, slow blink, proper refresh - Changed ~ to " A" (space + capital A, no inverted background) - Blink: on 500ms / off 1500ms (once per 2s) - Home screen refresh rate drops to 500ms when auto-advert is active so the blink is actually visible Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/ui-new/UITask.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index edf435ba..ef5f6b45 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -1798,13 +1798,8 @@ public: display.translateUTF8ToBlocks(filtered_name, _node_prefs->node_name, sizeof(filtered_name)); display.setCursor(0, 0); display.print(filtered_name); - if (_node_prefs->advert_auto_interval_sec > 0 && (millis() / 250) % 2) { - int ax = display.getTextWidth(filtered_name); - display.fillRect(ax, 0, display.getTextWidth("~") + 1, 9); - display.setColor(DisplayDriver::DARK); - display.setCursor(ax, 0); - display.print("~"); - display.setColor(DisplayDriver::LIGHT); + if (_node_prefs->advert_auto_interval_sec > 0 && (millis() % 2000) < 500) { + display.print(" A"); } renderBatteryIndicator(display, _task->getBattMilliVolts()); } @@ -2141,11 +2136,12 @@ public: display.drawTextCentered(display.width() / 2, 64 - 11, "hibernate:" PRESS_LABEL); } } + bool auto_adv = _node_prefs && _node_prefs->advert_auto_interval_sec > 0; if (_page == HomePage::CLOCK) { bool show_sec = !_node_prefs || !_node_prefs->clock_hide_seconds; - return show_sec ? 1000 : 60000; + return auto_adv ? 500 : (show_sec ? 1000 : 60000); } - return 5000; + return auto_adv ? 500 : 5000; } bool handleInput(char c) override {