mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2024-11-06 18:57:42 +01:00
cache real sample rate with 1Hz resolution instead of the desired rate
This commit is contained in:
parent
932d6a6fb2
commit
bcb8f2b28a
@ -102,7 +102,6 @@ int e4000_set_bw(void *dev, int bw) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int e4000_set_gain(void *dev, int gain) {
|
int e4000_set_gain(void *dev, int gain) {
|
||||||
int rc;
|
|
||||||
rtlsdr_dev_t* devt = (rtlsdr_dev_t*)dev;
|
rtlsdr_dev_t* devt = (rtlsdr_dev_t*)dev;
|
||||||
int mixgain = (gain > 340) ? 12 : 4;
|
int mixgain = (gain > 340) ? 12 : 4;
|
||||||
int enhgain = (gain - 420);
|
int enhgain = (gain - 420);
|
||||||
@ -744,11 +743,11 @@ int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t samp_rate)
|
|||||||
|
|
||||||
if (dev->tuner && dev->tuner->set_bw) {
|
if (dev->tuner && dev->tuner->set_bw) {
|
||||||
rtlsdr_set_i2c_repeater(dev, 1);
|
rtlsdr_set_i2c_repeater(dev, 1);
|
||||||
dev->tuner->set_bw(dev, real_rate);
|
dev->tuner->set_bw(dev, (int)real_rate);
|
||||||
rtlsdr_set_i2c_repeater(dev, 0);
|
rtlsdr_set_i2c_repeater(dev, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->rate = samp_rate;
|
dev->rate = (uint32_t)real_rate;
|
||||||
|
|
||||||
tmp = (rsamp_ratio >> 16);
|
tmp = (rsamp_ratio >> 16);
|
||||||
rtlsdr_demod_write_reg(dev, 1, 0x9f, tmp, 2);
|
rtlsdr_demod_write_reg(dev, 1, 0x9f, tmp, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user