From bca5edb57979983a9eb8d6cd1016961552ad217c Mon Sep 17 00:00:00 2001 From: michael-west Date: Wed, 25 Jun 2014 14:56:20 -0700 Subject: Fix for BUG #492: UHD: set_time_unknown_pps() fails with GPSDO installed - Added polling for PPS time change after setting time from GPSDO. --- host/lib/usrp/b200/b200_impl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'host/lib/usrp/b200') diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 261183128..f2b3885e6 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -477,6 +477,11 @@ b200_impl::b200_impl(const device_addr_t &device_addr) UHD_MSG(status) << "Initializing time to the internal GPSDO" << std::endl; const time_t tp = time_t(_gps->get_sensor("gps_time").to_int()+1); _tree->access(mb_path / "time" / "pps").set(time_spec_t(tp)); + + //wait for next PPS edge (timeout after 1 second) + time_spec_t pps_time = _tree->access(mb_path / "time" / "pps").get(); + for (size_t i = 0; i < 10 && _tree->access(mb_path / "time" / "pps").get() == pps_time; i++) + boost::this_thread::sleep(boost::posix_time::milliseconds(100)); } } -- cgit v1.2.3