EPIRB RX: add receiver-overload indicator on channel bar (#3212)

* EPIRB RX: add receiver-overload indicator on channel bar

Tint the channel-power bar red when the front-end overloads (ADC near
full scale). EPIRB demodulation relies on the constant-envelope carrier
and the +/-1.1 rad biphase phase jumps; ADC clipping distorts both, so a
visible cue to reduce RF-amp/LNA/VGA gain is useful.

Implemented in the shared ui::Channel widget via an opt-in
set_overload_threshold(): when the last ChannelStatistics max_db reaches
the threshold the bar is drawn red instead of blue. Default threshold is
above the 0 dBFS ceiling, so all existing users are unaffected. The
EPIRB view enables it at -3 dBFS.

Done in the widget (main firmware) rather than the EPIRB app because the
epirb_rx external app is already at the 32 KB flash limit; the app only
pays for a single setter call.
This commit is contained in:
Arne Luehrs
2026-06-11 11:10:23 +02:00
committed by GitHub
parent 569bcaad22
commit c7a0846645
2 changed files with 621 additions and 618 deletions
+5 -2
View File
@@ -49,11 +49,14 @@ class Channel : public Widget {
// instead of blue, flagging that the analog gain is too high and the ADC is
// clipping. Default is disabled (threshold above the 0 dBFS ceiling) so
// existing users are unaffected.
void set_overload_threshold(int32_t db) { overload_threshold_ = db; }
void set_overload_threshold(int32_t db) {
overload_threshold_ = db;
set_dirty();
}
private:
int32_t max_db_;
int32_t overload_threshold_{1};
int32_t overload_threshold_{INT32_MAX};
MessageHandlerRegistration message_handler_stats{
Message::ID::ChannelStatistics,