From 11a3799a4713778959b425bc4a23e102b48b7bc5 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Fri, 19 Jun 2026 14:53:15 +0200 Subject: [PATCH] fix(repeater): hide name-bar power readout while APC is suppressed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The name-bar live-power readout was gated on the raw tx_apc pref, so after an upgrade with Auto pwr previously on, it kept showing a power value while the repeater was active — looking like APC was running even though it's forced off and power is pinned to the ceiling. Gate it on apcActive() instead (now public), matching the "--" lock in Settings. The radio page's TX line still shows the actual power, as before. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/MyMesh.h | 10 +++++----- examples/companion_radio/ui-new/UITask.cpp | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/companion_radio/MyMesh.h b/examples/companion_radio/MyMesh.h index 28b81536..3369cca2 100644 --- a/examples/companion_radio/MyMesh.h +++ b/examples/companion_radio/MyMesh.h @@ -156,11 +156,6 @@ protected: // Overhear suppression only makes sense while repeating; gated behind its own // opt-in pref (Settings > Radio > Suppress dup). bool wantsOverhearSuppress() const override { return _prefs.client_repeat && _prefs.repeat_suppress_dup; } - // Adaptive Power Control is suppressed while repeating: a repeater wants full, - // consistent TX power for relay reach, and its feedback sources (own ACKs / - // own flood echoes) don't fire on forwarded traffic anyway. applyApc() then - // pins power to the ceiling. - bool apcActive() const { return _prefs.tx_apc && !_prefs.client_repeat; } void sendFloodScoped(const TransportKey& scope, mesh::Packet* pkt, uint32_t delay_millis); void sendFloodScoped(const ContactInfo& recipient, mesh::Packet* pkt, uint32_t delay_millis=0) override; @@ -232,6 +227,11 @@ public: void saveRTCTime() { _store->saveRTCTime(); } DataStore* getDataStore() const { return _store; } void applyApc(); // (re)initialise Adaptive Power Control from prefs + // Adaptive Power Control is suppressed while repeating: a repeater wants full, + // consistent TX power for relay reach, and its feedback sources (own ACKs / + // own flood echoes) don't fire on forwarded traffic anyway. applyApc() then + // pins power to the ceiling. + bool apcActive() const { return _prefs.tx_apc && !_prefs.client_repeat; } // True when the optional repeater radio profile is a valid LoRa config. bool repeaterProfileValid() const { diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index cf1d285d..6804efe9 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -542,7 +542,11 @@ public: display.translateUTF8ToBlocks(filtered_name, _node_prefs->node_name, sizeof(filtered_name)); int rightEdge = renderBatteryIndicator(display, _task->getBattMilliVolts()); display.setColor(DisplayDriver::LIGHT); - if (_node_prefs && _node_prefs->tx_apc) { + // Only show the live-power readout when APC is actually controlling power — + // not merely when the pref is set. While repeating APC is suppressed and + // power is pinned to the ceiling, so apcActive() is false and the name bar + // drops the readout (matching the "--" lock in Settings). + if (the_mesh.apcActive()) { char pwr_buf[8]; snprintf(pwr_buf, sizeof(pwr_buf), "%ddB", (int)radio_driver.getTxPower()); int pwr_w = display.getTextWidth(pwr_buf);