From 63f4049a101d66c01f7e89098b03f3f780647cbd Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 20 Nov 2017 13:16:34 -0800 Subject: mg: Enable variable master clock rates The master_clock_rate argument is passed to init() during initialization; this change allows to query the correct MCR at initialization time. It does not allow changing the MCR while a session is active. The MCR also affects the LO settings; it is the reference clock for the lowband LOs. --- host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp') diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp index 27cf926a2..191218133 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp @@ -37,9 +37,8 @@ void magnesium_radio_ctrl_impl::_init_defaults() UHD_LOG_TRACE(unique_id(), "Num TX chans: " << num_tx_chans << " Num RX chans: " << num_rx_chans); - UHD_LOG_TRACE(unique_id(), - "Setting tick rate to " << MAGNESIUM_TICK_RATE / 1e6 << " MHz"); - radio_ctrl_impl::set_rate(MAGNESIUM_TICK_RATE); + // get_rate() is useless until we can ask MPM for the actual rate + radio_ctrl_impl::set_rate(1.0); for (size_t chan = 0; chan < num_rx_chans; chan++) { radio_ctrl_impl::set_rx_frequency(MAGNESIUM_CENTER_FREQ, chan); @@ -397,7 +396,9 @@ void magnesium_radio_ctrl_impl::_init_prop_tree() // TODO remove this dirty hack if (not _tree->exists("tick_rate")) { - _tree->create("tick_rate").set(MAGNESIUM_TICK_RATE); + _tree->create("tick_rate") + .set_publisher([this](){ return this->get_rate(); }) + ; } } -- cgit v1.2.3