aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300/x300_impl.cpp
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2015-10-14 11:57:15 -0700
committerMartin Braun <martin.braun@ettus.com>2015-12-10 14:21:49 -0800
commitc21c5ee6fe6c0e30ac803b308d74ec77317a456f (patch)
tree141d27b1a889b8c593a2ac6bb6e0ee5d60bdd462 /host/lib/usrp/x300/x300_impl.cpp
parentf90b62f3871fb701a8d9cb7c91c1a7f3421fced9 (diff)
downloaduhd-c21c5ee6fe6c0e30ac803b308d74ec77317a456f.tar.gz
uhd-c21c5ee6fe6c0e30ac803b308d74ec77317a456f.tar.bz2
uhd-c21c5ee6fe6c0e30ac803b308d74ec77317a456f.zip
E300/X300: Add VITA time synchronization on internal signal
Diffstat (limited to 'host/lib/usrp/x300/x300_impl.cpp')
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 1e424414e..ebb9bf3a6 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -764,8 +764,8 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
////////////////////////////////////////////////////////////////////
_tree->create<time_spec_t>(mb_path / "time" / "now")
.publish(boost::bind(&time_core_3000::get_time_now, mb.radio_perifs[0].time64))
- .subscribe(boost::bind(&time_core_3000::set_time_now, mb.radio_perifs[0].time64, _1))
- .subscribe(boost::bind(&time_core_3000::set_time_now, mb.radio_perifs[1].time64, _1));
+ .subscribe(boost::bind(&x300_impl::sync_times, this, mb, _1))
+ .set(0.0);
_tree->create<time_spec_t>(mb_path / "time" / "pps")
.publish(boost::bind(&time_core_3000::get_time_last_pps, mb.radio_perifs[0].time64))
.subscribe(boost::bind(&time_core_3000::set_time_next_pps, mb.radio_perifs[0].time64, _1))
@@ -1457,6 +1457,14 @@ void x300_impl::update_time_source(mboard_members_t &mb, const std::string &sour
*/
}
+void x300_impl::sync_times(mboard_members_t &mb, const uhd::time_spec_t& t)
+{
+ BOOST_FOREACH(radio_perifs_t &perif, mb.radio_perifs)
+ perif.time64->set_time_sync(t);
+ mb.fw_regmap->clock_ctrl_reg.write(fw_regmap_t::clk_ctrl_reg_t::TIME_SYNC, 1);
+ mb.fw_regmap->clock_ctrl_reg.write(fw_regmap_t::clk_ctrl_reg_t::TIME_SYNC, 0);
+}
+
bool x300_impl::wait_for_clk_locked(mboard_members_t& mb, boost::uint32_t which, double timeout)
{
boost::system_time timeout_time = boost::get_system_time() + boost::posix_time::milliseconds(timeout * 1000.0);