diff options
author | michael-west <michael.west@ettus.com> | 2014-02-21 13:16:31 -0800 |
---|---|---|
committer | michael-west <michael.west@ettus.com> | 2014-02-21 13:16:31 -0800 |
commit | fe90695e96630864e376e3becee30cb1f01083b8 (patch) | |
tree | d427cdff0285cbeeab5378518c59be7348fbfac9 /host/lib | |
parent | 9ccd93ab11ebf2338b763a86aaf740c710fcc13d (diff) | |
download | uhd-fe90695e96630864e376e3becee30cb1f01083b8.tar.gz uhd-fe90695e96630864e376e3becee30cb1f01083b8.tar.bz2 uhd-fe90695e96630864e376e3becee30cb1f01083b8.zip |
- Added wait for reference clock to lock.
- Modified wait for GPSDO time setting to timeout after 1 second.
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index a231d7059..a92a1c806 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -610,6 +610,10 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) dev_addr.cast<double>("master_clock_rate", X300_DEFAULT_TICK_RATE), dev_addr.cast<double>("system_ref_rate", X300_DEFAULT_SYSREF_RATE)); + //wait for reference clock to lock + while (not get_ref_locked(mb.zpu_ctrl).to_bool()) + boost::this_thread::sleep(boost::posix_time::milliseconds(100)); + //////////////////////////////////////////////////////////////////// // create clock properties //////////////////////////////////////////////////////////////////// @@ -782,7 +786,9 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) UHD_MSG(status) << "Initializing time to the GPSDO time" << std::endl; const time_t tp = time_t(mb.gps->get_sensor("gps_time").to_int()+1); _tree->access<time_spec_t>(mb_path / "time" / "pps").set(time_spec_t(tp)); - boost::this_thread::sleep(boost::posix_time::seconds(1)); //wait for time to be set + //wait for time to be set (timeout after 1 second) + for (int i = 0; i < 10 && tp != (_tree->access<time_spec_t>(mb_path / "time" / "pps").get()).get_full_secs(); i++) + boost::this_thread::sleep(boost::posix_time::milliseconds(100)); } else { _tree->access<std::string>(mb_path / "clock_source" / "value").set("internal"); _tree->access<std::string>(mb_path / "time_source" / "value").set("internal"); |