diff --git a/readsb.c b/readsb.c index 46e63a7b..b4b7024a 100644 --- a/readsb.c +++ b/readsb.c @@ -1565,7 +1565,7 @@ static void parseGainOpt(char *arg) { } else { Modes.loudThreshold = 243; } - fprintf(stderr, "startingGain: %4.1f noiseLowThreshold: %3d noiseHighThreshold: %3d loudThreshold: %3d\n", + fprintf(stderr, "lowestGain: %4.1f noiseLowThreshold: %3d noiseHighThreshold: %3d loudThreshold: %3d\n", Modes.gain / 10.0, Modes.noiseLowThreshold, Modes.noiseHighThreshold, Modes.loudThreshold); } else { Modes.gain = (int) (atof(arg)*10); // Gain is in tens of DBs diff --git a/sdr_rtlsdr.c b/sdr_rtlsdr.c index 5872e587..fb3bb470 100644 --- a/sdr_rtlsdr.c +++ b/sdr_rtlsdr.c @@ -121,6 +121,10 @@ void rtlsdrSetGain(char *reason) { Modes.increaseGain = 0; Modes.lowerGain = 0; + if (RTLSDR.gains[closest] < Modes.minGain) { + // new gain less than minimum, nothing to do + return; + } if (Modes.gain == RTLSDR.gains[closest]) { // same gain, nothing to do return;