From e205f3712d4c2825bac63a9f15ec5af83ce75469 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Thu, 14 May 2026 17:41:33 +0200 Subject: [PATCH] fix: auto-advert indicator - inverted A, 50% duty 1s blink, 1s refresh Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/ui-new/UITask.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 6fc39d72..96ad456c 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -1798,8 +1798,15 @@ 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() % 2000) < 500) { - display.print(" A"); + if (_node_prefs->advert_auto_interval_sec > 0 && (millis() % 1000) < 500) { + int spaceW = display.getTextWidth(" "); + int aW = display.getTextWidth("A"); + int ax = display.getTextWidth(filtered_name) + spaceW; + display.fillRect(ax, 0, aW + 1, 8); + display.setColor(DisplayDriver::DARK); + display.setCursor(ax, 0); + display.print("A"); + display.setColor(DisplayDriver::LIGHT); } renderBatteryIndicator(display, _task->getBattMilliVolts()); } @@ -2139,9 +2146,9 @@ public: 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 auto_adv ? 500 : (show_sec ? 1000 : 60000); + return (auto_adv || show_sec) ? 1000 : 60000; } - return auto_adv ? 500 : 5000; + return auto_adv ? 1000 : 5000; } bool handleInput(char c) override {