From 09f3d0d7ca0b47c79a412b41810479ba3cf24936 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 19 Jul 2017 12:26:50 -0700 Subject: utils: Fixed query_gpsdo_sensors warmup timeout condition --- host/utils/query_gpsdo_sensors.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'host/utils') 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 &) { -- cgit v1.2.3