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 Jul 25, 2023
1 parent 88be527 commit 400e864
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 @@ -283,6 +283,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.0) && (gain <= 160.0)) {
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 400e864

Please sign in to comment.