diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-07-19 12:26:50 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-07-24 13:41:00 -0700 |
commit | 09f3d0d7ca0b47c79a412b41810479ba3cf24936 (patch) | |
tree | fac5e5393e2a5362ed20561e5ec310215c6b9440 | |
parent | 4d10747a0409cf15ad7843707c3c18dbe98a35ab (diff) | |
download | uhd-09f3d0d7ca0b47c79a412b41810479ba3cf24936.tar.gz uhd-09f3d0d7ca0b47c79a412b41810479ba3cf24936.tar.bz2 uhd-09f3d0d7ca0b47c79a412b41810479ba3cf24936.zip |
utils: Fixed query_gpsdo_sensors warmup timeout condition
-rw-r--r-- | host/utils/query_gpsdo_sensors.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/host/utils/query_gpsdo_sensors.cpp b/host/utils/query_gpsdo_sensors.cpp index 6c2ec0bd1..9091bcb24 100644 --- a/host/utils/query_gpsdo_sensors.cpp +++ b/host/utils/query_gpsdo_sensors.cpp @@ -34,6 +34,8 @@ namespace po = boost::program_options; namespace fs = boost::filesystem; +const size_t WARMUP_TIMEOUT_MS = 30000; + void print_notes(void) { // Helpful notes std::cout << boost::format("**************************************Helpful Notes on Clock/PPS Selection**************************************\n"); @@ -171,14 +173,18 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ print_notes(); // The TCXO has a long warm up time, so wait up to 30 seconds for sensor data to show up - std::cout << "Waiting for the GPSDO to warm up..." << std::endl; - for (size_t i = 0; i < 300; i++) { + std::cout << "Waiting for the GPSDO to warm up..." << std::flush; + boost::system_time exit_time = boost::get_system_time() + + boost::posix_time::milliseconds(WARMUP_TIMEOUT_MS); + while (boost::get_system_time() < exit_time) { try { usrp->get_mboard_sensor("gps_locked",0); break; } catch (std::exception &) {} boost::this_thread::sleep(boost::posix_time::milliseconds(100)); + std::cout << "." << std::flush; } + std::cout << std::endl; try { usrp->get_mboard_sensor("gps_locked",0); } catch (std::exception &) { |