Skip to content

Commit

Permalink
fixup --gain -10
Browse files Browse the repository at this point in the history
was broken while implementing autogain
bad setting regardless, use 58 instead of -10 to set maximum gain on
rtl-sdr
  • Loading branch information
wiedehopf committed Nov 18, 2024
1 parent e8de536 commit 079fda3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sdr_rtlsdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ static int getClosestGainIndex(int target) {
}

void rtlsdrSetGain(char *reason) {
if (Modes.gain == MODES_AUTO_GAIN || Modes.gain >= 520) {
Modes.gain = MODES_RTL_AGC;
}

if (Modes.increaseGain || Modes.lowerGain) {
int closest = getClosestGainIndex(Modes.gain);
if (Modes.increaseGain) {
Expand Down Expand Up @@ -137,8 +141,7 @@ void rtlsdrSetGain(char *reason) {
if (Modes.gain < 0) {
Modes.gain = 0;
}
if (Modes.gain == MODES_AUTO_GAIN || Modes.gain >= 520) {
Modes.gain = MODES_RTL_AGC;
if (Modes.gain == MODES_RTL_AGC) {

RTLSDR.tunerAgcEnabled = 1;
if (!Modes.gainQuiet) {
Expand Down

0 comments on commit 079fda3

Please sign in to comment.