diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2018-10-03 19:00:12 -0700 |
---|---|---|
committer | Brent Stapleton <bstapleton@g.hmc.edu> | 2018-10-12 10:27:55 -0700 |
commit | 06970692ae172aad68e4826b447d6f712e2970b8 (patch) | |
tree | 094a8e8027a56af8151d1f24ae9c7a9b7f7053c2 /host/examples/benchmark_rate.cpp | |
parent | d46d3be5090949f0d47c6d618287057ae5768712 (diff) | |
download | uhd-06970692ae172aad68e4826b447d6f712e2970b8.tar.gz uhd-06970692ae172aad68e4826b447d6f712e2970b8.tar.bz2 uhd-06970692ae172aad68e4826b447d6f712e2970b8.zip |
utils: fix bmark_rate MIMO synchronization
Fix USRP2 MIMO synchronization in benchmark_rate.
When synchronizing N2XXs connected with a MIMO cable, only the master's
time needs to be set; the slave will be synchronized automatically.
Currently, calling set_time_unknown_pps will attempt to synchronize the
slave on the next PPS, which can cause problems since the MIMO cable
doesn't propogate a PPS signal.
Diffstat (limited to 'host/examples/benchmark_rate.cpp')
-rw-r--r-- | host/examples/benchmark_rate.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/host/examples/benchmark_rate.cpp b/host/examples/benchmark_rate.cpp index 88be83a7b..3a089dc62 100644 --- a/host/examples/benchmark_rate.cpp +++ b/host/examples/benchmark_rate.cpp @@ -469,16 +469,17 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ } std::cout << boost::format("[%s] Setting device timestamp to 0...") % NOW() << std::endl; - const bool sync_channels = - pps == "mimo" or - ref == "mimo" or - rx_channel_nums.size() > 1 or - tx_channel_nums.size() > 1 - ; - if (!sync_channels) { - usrp->set_time_now(0.0); + if (pps == "mimo" or ref == "mimo") { + // only set the master's time, the slave's is automatically sync'd + usrp->set_time_now(uhd::time_spec_t(0.0), 0); + // ensure that the setter has completed + usrp->get_time_now(); + // wait for the time to sync + std::this_thread::sleep_for(std::chrono::milliseconds(1)); + } else if (rx_channel_nums.size() > 1 or tx_channel_nums.size() > 1) { + usrp->set_time_unknown_pps(uhd::time_spec_t(0.0)); } else { - usrp->set_time_unknown_pps(uhd::time_spec_t(0.0)); + usrp->set_time_now(0.0); } //spawn the receive test thread |