mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2024-12-26 02:48:31 +01:00
make sure offset tuning works with gr-osmosdr
Signed-off-by: Steve Markgraf <steve@steve-m.de>
This commit is contained in:
parent
3fdea955ca
commit
ac05f9084c
@ -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, 0x14, 1);
|
||||||
r |= rtlsdr_demod_write_reg(dev, 1, 0x01, 0x10, 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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1056,6 +1060,7 @@ int rtlsdr_set_offset_tuning(rtlsdr_dev_t *dev, int on)
|
|||||||
rtlsdr_set_i2c_repeater(dev, 0);
|
rtlsdr_set_i2c_repeater(dev, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dev->freq > dev->offs_freq)
|
||||||
r |= rtlsdr_set_center_freq(dev, dev->freq);
|
r |= rtlsdr_set_center_freq(dev, dev->freq);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
Loading…
Reference in New Issue
Block a user