diff options
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/Dexter.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/output/Dexter.cpp b/src/output/Dexter.cpp index 515d810..2d053aa 100644 --- a/src/output/Dexter.cpp +++ b/src/output/Dexter.cpp @@ -277,12 +277,18 @@ Dexter::~Dexter() void Dexter::tune(double lo_offset, double frequency) { - // TODO lo_offset - long long freq = m_conf.frequency - 204800000; + // lo_offset is applied to the DSP, and frequency is given to the ad9957 + + long long freq = frequency; int r = 0; + if ((r = iio_device_attr_write_longlong(m_ad9957_tx0, "center_frequency", freq)) != 0) { + etiLog.level(warn) << "Failed to set ad9957_tx0.center_frequency = " << freq << " : " << get_iio_error(r); + } + + long long lo_offs = lo_offset; - if ((r = iio_device_attr_write_longlong(m_dexter_dsp_tx, "frequency0", freq)) != 0) { - etiLog.level(warn) << "Failed to set dexter_dsp_tx.frequency0 = " << freq << " : " << get_iio_error(r); + if ((r = iio_device_attr_write_longlong(m_dexter_dsp_tx, "frequency0", lo_offs)) != 0) { + etiLog.level(warn) << "Failed to set dexter_dsp_tx.frequency0 = " << lo_offs << " : " << get_iio_error(r); } } |