aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils/uhd_cal_tx_dc_offset.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-08-20 18:03:12 -0700
committerMartin Braun <martin.braun@ettus.com>2018-08-29 15:50:30 -0700
commit09ac6991c3e7afed6bf75dadb16363965fbf54ce (patch)
treedc23ccf9b2ba66a3490648c8cd5a3741bb5ac9ca /host/utils/uhd_cal_tx_dc_offset.cpp
parentbed75f0ccbb6da139283a07c1442293bef95f26a (diff)
downloaduhd-09ac6991c3e7afed6bf75dadb16363965fbf54ce.tar.gz
uhd-09ac6991c3e7afed6bf75dadb16363965fbf54ce.tar.bz2
uhd-09ac6991c3e7afed6bf75dadb16363965fbf54ce.zip
utils: Factor wait_for_lo_lock() out of cal utils
Diffstat (limited to 'host/utils/uhd_cal_tx_dc_offset.cpp')
-rw-r--r--host/utils/uhd_cal_tx_dc_offset.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/host/utils/uhd_cal_tx_dc_offset.cpp b/host/utils/uhd_cal_tx_dc_offset.cpp
index ecd676e07..6c35f017f 100644
--- a/host/utils/uhd_cal_tx_dc_offset.cpp
+++ b/host/utils/uhd_cal_tx_dc_offset.cpp
@@ -81,14 +81,7 @@ static double tune_rx_and_tx(uhd::usrp::multi_usrp::sptr usrp, const double tx_l
rx_tune_req.dsp_freq = rx_freq - max_fe_rx_freq;
usrp->set_rx_freq(rx_tune_req);
- //wait for the LOs to become locked
- std::this_thread::sleep_for(std::chrono::milliseconds(50));
- boost::system_time start = boost::get_system_time();
- while (not usrp->get_tx_sensor("lo_locked").to_bool() or not usrp->get_rx_sensor("lo_locked").to_bool())
- {
- if (boost::get_system_time() > start + boost::posix_time::milliseconds(100))
- throw std::runtime_error("timed out waiting for TX and/or RX LO to lock");
- }
+ wait_for_lo_lock(usrp);
return usrp->get_tx_freq();
}