From abc6906834f2c0779980777f91ec1395493f5e03 Mon Sep 17 00:00:00 2001 From: Vladislav P Date: Tue, 6 Jun 2023 20:09:08 +0300 Subject: [PATCH] rx_agc: avoid manual gain updates in auto mode --- src/dsp/rx_agc_xx.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dsp/rx_agc_xx.cpp b/src/dsp/rx_agc_xx.cpp index f5a1c11f1..4662cdba7 100644 --- a/src/dsp/rx_agc_xx.cpp +++ b/src/dsp/rx_agc_xx.cpp @@ -280,6 +280,11 @@ void rx_agc_2f::set_target_level(int target_level) */ void rx_agc_2f::set_manual_gain(float gain) { + if(d_agc_on) + { + d_manual_gain = gain; + return; + } if ((gain != d_manual_gain) && (gain >= -160.f) && (gain <= 160.f)) { std::lock_guard lock(d_mutex); set_parameters(d_sample_rate, d_agc_on, d_target_level, gain, d_max_gain, d_attack, d_decay, d_hang);