summaryrefslogtreecommitdiffstats
path: root/host/utils
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2013-04-09 20:34:23 -0500
committerJosh Blum <josh@joshknows.com>2013-04-09 20:34:23 -0500
commit31f0e964aa54a2c8e4d299432513623d2c49bbf0 (patch)
treeb6005df7b94692523a09e110d30812c8f595a574 /host/utils
parent417a70fee7d80cd13e509c4460c9fd5b0bdca8b9 (diff)
downloaduhd-31f0e964aa54a2c8e4d299432513623d2c49bbf0.tar.gz
uhd-31f0e964aa54a2c8e4d299432513623d2c49bbf0.tar.bz2
uhd-31f0e964aa54a2c8e4d299432513623d2c49bbf0.zip
gps: flush uart buffer before waiting for time
This addresses a bug only on the master branch. Also turn off the servo sensor, its too long a delay. We will need to conditionally enable this in a later commit.
Diffstat (limited to 'host/utils')
-rw-r--r--host/utils/query_gpsdo_sensors.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/host/utils/query_gpsdo_sensors.cpp b/host/utils/query_gpsdo_sensors.cpp
index b49a4aa99..91088112c 100644
--- a/host/utils/query_gpsdo_sensors.cpp
+++ b/host/utils/query_gpsdo_sensors.cpp
@@ -103,6 +103,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//Check PPS and compare UHD device time to GPS time
boost::this_thread::sleep(boost::posix_time::seconds(1));
uhd::sensor_value_t gps_time = usrp->get_mboard_sensor("gps_time");
+ const time_t pc_clock_time = time(NULL);
const uhd::time_spec_t last_pps_time = usrp->get_time_last_pps();
if (last_pps_time.to_ticks(1.0) == gps_time.to_int()) {
std::cout << boost::format("GPS and UHD Device time are aligned.\n");
@@ -115,7 +116,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
uhd::sensor_value_t rmc_string = usrp->get_mboard_sensor("gps_gprmc");
std::cout << boost::format("%s\n%s\n%s\n") % gga_string.to_pp_string() % rmc_string.to_pp_string() % gps_time.to_pp_string();
std::cout << boost::format("UHD Device time: %.0f seconds\n") % (last_pps_time.get_real_secs());
- std::cout << boost::format("PC Clock time: %.0f seconds\n") % time(NULL);
+ std::cout << boost::format("PC Clock time: %.0f seconds\n") % pc_clock_time;
//finished
std::cout << boost::format("\nDone!\n\n");