From 8a4f5b7c4df40666257b65fea9c10d1a9980cbd0 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 9 Dec 2021 11:41:18 +0100 Subject: e3xx: Fix frequency querying The E3xx devices have one LO per TX/RX, respectively. That means when changing the frequency on channel 0, the frequency on channel 1 also gets changed. The code didn't track this change properly: When setting channel 1, channel 0's frequency didn't match. --- host/lib/usrp/dboard/e3xx/e3xx_radio_control_impl.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/dboard/e3xx/e3xx_radio_control_impl.cpp b/host/lib/usrp/dboard/e3xx/e3xx_radio_control_impl.cpp index 68f0bfeaf..09be505fc 100644 --- a/host/lib/usrp/dboard/e3xx/e3xx_radio_control_impl.cpp +++ b/host/lib/usrp/dboard/e3xx/e3xx_radio_control_impl.cpp @@ -224,7 +224,12 @@ double e3xx_radio_control_impl::set_tx_frequency(const double freq, const size_t double coerced_freq = _ad9361->tune(get_which_ad9361_chain(TX_DIRECTION, chan, _fe_swap), clipped_freq); - radio_control_impl::set_tx_frequency(coerced_freq, chan); + // The E3xx devices have one LO for TX, so if we change one channel's + // frequency, we change the other, too + for (size_t chan_idx = 0; chan_idx < E3XX_NUM_CHANS; ++chan_idx) { + radio_control_impl::set_tx_frequency(coerced_freq, chan_idx); + } + // Front-end switching _set_atr_bits(chan); @@ -240,7 +245,11 @@ double e3xx_radio_control_impl::set_rx_frequency(const double freq, const size_t double coerced_freq = _ad9361->tune(get_which_ad9361_chain(RX_DIRECTION, chan, _fe_swap), clipped_freq); - radio_control_impl::set_rx_frequency(coerced_freq, chan); + // The E3xx devices have one LO for RX, so if we change one channel's + // frequency, we change the other, too + for (size_t chan_idx = 0; chan_idx < E3XX_NUM_CHANS; ++chan_idx) { + radio_control_impl::set_rx_frequency(coerced_freq, chan_idx); + } // Front-end switching _set_atr_bits(chan); -- cgit v1.2.3