From ea7cc7f8250cd9bdb41c1f22703d38be91fb6a84 Mon Sep 17 00:00:00 2001 From: Trung N Tran Date: Mon, 11 Dec 2017 19:52:12 -0800 Subject: mg: external LO need update correct freq Need to update rf freq to half of ad9371 --- .../usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp index c7087532d..8fa500872 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp @@ -269,9 +269,20 @@ void magnesium_radio_ctrl_impl::_update_freq( const size_t chan, const uhd::direction_t dir ) { + const std::string ad9371_source = dir == TX_DIRECTION ? + this->get_tx_lo_source(MAGNESIUM_LO1, chan) : + this->get_rx_lo_source(MAGNESIUM_LO1, chan) + ; + + const double ad9371_freq = ad9371_source == "external" ? + _ad9371_freq[dir]/2 : + _ad9371_freq[dir] + ; const double rf_freq = _is_low_band[dir] ? - _ad9371_freq[dir] - _adf4351_freq[dir] : - _ad9371_freq[dir]; + ad9371_freq - _adf4351_freq[dir] : + ad9371_freq + ; + UHD_LOG_TRACE(unique_id(), "RF freq = " << rf_freq); UHD_ASSERT_THROW(rf_freq >= 0); -- cgit v1.2.3