aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/multi_usrp.cpp
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2014-08-20 09:06:32 -0700
committerAshish Chaudhari <ashish@ettus.com>2014-08-20 09:06:32 -0700
commit72eae0503393966dfb2b961835ad1f9c5e5265e7 (patch)
tree60db7af4b572f280f3017b8ba3a5f39657c58816 /host/lib/usrp/multi_usrp.cpp
parent505c1d84fa7c53c0c640fab73b88c164671c7b91 (diff)
parentd31ffb2ef869b05fc4aeafd6bf588e62dca7ee82 (diff)
downloaduhd-72eae0503393966dfb2b961835ad1f9c5e5265e7.tar.gz
uhd-72eae0503393966dfb2b961835ad1f9c5e5265e7.tar.bz2
uhd-72eae0503393966dfb2b961835ad1f9c5e5265e7.zip
Merge branch 'master' into ashish/cat_refactor_phase2
Diffstat (limited to 'host/lib/usrp/multi_usrp.cpp')
-rw-r--r--host/lib/usrp/multi_usrp.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp
index 7d19fcb8b..388cf03fa 100644
--- a/host/lib/usrp/multi_usrp.cpp
+++ b/host/lib/usrp/multi_usrp.cpp
@@ -394,17 +394,19 @@ public:
void set_time_unknown_pps(const time_spec_t &time_spec){
UHD_MSG(status) << " 1) catch time transition at pps edge" << std::endl;
- time_spec_t time_start = get_time_now();
+ boost::system_time end_time = boost::get_system_time() + boost::posix_time::milliseconds(1100);
time_spec_t time_start_last_pps = get_time_last_pps();
- while(true){
- if (get_time_last_pps() != time_start_last_pps) break;
- if ((get_time_now() - time_start) > time_spec_t(1.1)){
+ while (time_start_last_pps == get_time_last_pps())
+ {
+ if (boost::get_system_time() > end_time)
+ {
throw uhd::runtime_error(
"Board 0 may not be getting a PPS signal!\n"
"No PPS detected within the time interval.\n"
"See the application notes for your device.\n"
);
}
+ boost::this_thread::sleep(boost::posix_time::milliseconds(1));
}
UHD_MSG(status) << " 2) set times next pps (synchronously)" << std::endl;