Skip to content

Commit

Permalink
rx_agc: avoid manual gain updates in auto mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vladisslav2011 committed Sep 24, 2024
1 parent 5338780 commit abc6906
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dsp/rx_agc_xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::mutex> lock(d_mutex);
set_parameters(d_sample_rate, d_agc_on, d_target_level, gain, d_max_gain, d_attack, d_decay, d_hang);
Expand Down

0 comments on commit abc6906

Please sign in to comment.