aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-20 13:16:34 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:07 -0800
commit63f4049a101d66c01f7e89098b03f3f780647cbd (patch)
tree393d31541c18d6e2cbbcc217c16afee2cba00a70 /host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp
parent59ecec43d4120e0b8e5d5d6ede1c673b5575a14f (diff)
downloaduhd-63f4049a101d66c01f7e89098b03f3f780647cbd.tar.gz
uhd-63f4049a101d66c01f7e89098b03f3f780647cbd.tar.bz2
uhd-63f4049a101d66c01f7e89098b03f3f780647cbd.zip
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.
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp9
1 files changed, 5 insertions, 4 deletions
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<double>("tick_rate").set(MAGNESIUM_TICK_RATE);
+ _tree->create<double>("tick_rate")
+ .set_publisher([this](){ return this->get_rate(); })
+ ;
}
}