diff options
author | Martin Braun <martin.braun@ettus.com> | 2014-07-31 15:25:22 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2014-07-31 15:25:22 +0200 |
commit | 4999b5df50d4e859bc3c95c2cbe0efc58df5c42a (patch) | |
tree | cc80a46c215a2af8285a3b6353417c1135adbbcb /host/lib/usrp/usrp2 | |
parent | cc6414ebcfa637cac5a66872c20848c30f2ee987 (diff) | |
parent | fb47c829c2006ff42d5fc5e167060c801c463325 (diff) | |
download | uhd-4999b5df50d4e859bc3c95c2cbe0efc58df5c42a.tar.gz uhd-4999b5df50d4e859bc3c95c2cbe0efc58df5c42a.tar.bz2 uhd-4999b5df50d4e859bc3c95c2cbe0efc58df5c42a.zip |
Merge branch 'maint'
Conflicts:
host/utils/usrp_burn_mb_eeprom.cpp
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index ae2a6f81d..2ad15aade 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -35,6 +35,7 @@ #include <boost/assign/list_of.hpp> #include <boost/asio/ip/address_v4.hpp> #include <boost/asio.hpp> //used for htonl and ntohl +#include <boost/thread.hpp> using namespace uhd; using namespace uhd::usrp; @@ -761,7 +762,13 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){ _tree->access<std::string>(root / "time_source/value").set("gpsdo"); _tree->access<std::string>(root / "clock_source/value").set("gpsdo"); UHD_MSG(status) << "Initializing time to the internal GPSDO" << std::endl; - _mbc[mb].time64->set_time_next_pps(time_spec_t(time_t(_mbc[mb].gps->get_sensor("gps_time").to_int()+1))); + const time_t tp = time_t(_mbc[mb].gps->get_sensor("gps_time").to_int()+1); + _tree->access<time_spec_t>(root / "time" / "pps").set(time_spec_t(tp)); + + //wait for next PPS edge (timeout after 1 second) + time_spec_t pps_time = _tree->access<time_spec_t>(root / "time" / "pps").get(); + for (size_t i = 0; i < 10 && _tree->access<time_spec_t>(root / "time" / "pps").get() == pps_time; i++) + boost::this_thread::sleep(boost::posix_time::milliseconds(100)); } } |