Merge pull request #9 from Mictronics/dev

Two bugs fixed
This commit is contained in:
Oliver Jowett 2017-02-22 17:00:06 +00:00 committed by GitHub
commit 3987cd59bc

View file

@ -198,7 +198,7 @@ bool rtlsdrOpen(void) {
// Set gain, frequency, sample rate, and reset the device
if (Modes.gain == MODES_AUTO_GAIN) {
fprintf(stderr, "rtlsdr: enabling tuner AGC\n");
rtlsdr_set_tuner_gain_mode(RTLSDR.dev, 1);
rtlsdr_set_tuner_gain_mode(RTLSDR.dev, 0);
} else {
int *gains;
int numgains;
@ -224,9 +224,9 @@ bool rtlsdrOpen(void) {
closest = i;
}
rtlsdr_set_tuner_gain(RTLSDR.dev, gains[closest]);
free(gains);
rtlsdr_set_tuner_gain(RTLSDR.dev, gains[closest]);
fprintf(stderr, "rtlsdr: tuner gain set to %.1f dB\n",
rtlsdr_get_tuner_gain(RTLSDR.dev)/10.0);
}