From c1e6da087946b522018996267441b8555791dabd Mon Sep 17 00:00:00 2001 From: michael-west Date: Wed, 14 Oct 2015 14:10:25 -0700 Subject: B210/E300: Re-sync times after master clock rate change. --- host/lib/usrp/b200/b200_impl.cpp | 3 +++ host/lib/usrp/e300/e300_impl.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index a18e595a6..dae90bbfe 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -626,6 +626,9 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s .publish(boost::bind(&time_core_3000::get_time_now, _radio_perifs[0].time64)) .subscribe(boost::bind(&b200_impl::sync_times, this, _1)) .set(0.0); + //re-sync the times when the tick rate changes + _tree->access(mb_path / "tick_rate") + .subscribe(boost::bind(&b200_impl::sync_times, this, _radio_perifs[0].time64->get_time_now())); _tree->create(mb_path / "time" / "pps") .publish(boost::bind(&time_core_3000::get_time_last_pps, _radio_perifs[0].time64)); BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs) diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp index bf108e171..5cc274bbb 100644 --- a/host/lib/usrp/e300/e300_impl.cpp +++ b/host/lib/usrp/e300/e300_impl.cpp @@ -530,6 +530,9 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr) .publish(boost::bind(&time_core_3000::get_time_now, _radio_perifs[0].time64)) .subscribe(boost::bind(&e300_impl::_sync_times, this, _1)) .set(0.0); + //re-sync the times when the tick rate changes + _tree->access(mb_path / "tick_rate") + .subscribe(boost::bind(&e300_impl::_sync_times, this, _radio_perifs[0].time64->get_time_now())); _tree->create(mb_path / "time" / "pps") .publish(boost::bind(&time_core_3000::get_time_last_pps, _radio_perifs[0].time64)) .subscribe(boost::bind(&time_core_3000::set_time_next_pps, _radio_perifs[0].time64, _1)) -- cgit v1.2.3