make sure offset tuning works with gr-osmosdr

Signed-off-by: Steve Markgraf <steve@steve-m.de>
master
Steve Markgraf 12 years ago
parent 3fdea955ca
commit ac05f9084c
  1. 7
      src/librtlsdr.c

@ -936,6 +936,10 @@ int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t samp_rate)
r |= rtlsdr_demod_write_reg(dev, 1, 0x01, 0x14, 1);
r |= rtlsdr_demod_write_reg(dev, 1, 0x01, 0x10, 1);
/* recalculate offset frequency if offset tuning is enabled */
if (dev->offs_freq)
rtlsdr_set_offset_tuning(dev, 1);
return r;
}
@ -1056,7 +1060,8 @@ int rtlsdr_set_offset_tuning(rtlsdr_dev_t *dev, int on)
rtlsdr_set_i2c_repeater(dev, 0);
}
r |= rtlsdr_set_center_freq(dev, dev->freq);
if (dev->freq > dev->offs_freq)
r |= rtlsdr_set_center_freq(dev, dev->freq);
return r;
}

Loading…
Cancel
Save