diff options
author | Johan Jansen <jnsn.johan@gmail.com> | 2015-04-07 17:15:33 +0200 |
---|---|---|
committer | Johan Jansen <jnsn.johan@gmail.com> | 2015-04-07 17:15:33 +0200 |
commit | 891a7af5099f380ac7ec737d8357fd9a9abf4c7a (patch) | |
tree | 5749155edbb4820a0ae2a01118769f1ffaa5b479 /src/drivers/gps/ubx.cpp | |
parent | a121f6101fb763ec61e5f447731ad0a155e2ac72 (diff) | |
download | px4-firmware-891a7af5099f380ac7ec737d8357fd9a9abf4c7a.tar.gz px4-firmware-891a7af5099f380ac7ec737d8357fd9a9abf4c7a.tar.bz2 px4-firmware-891a7af5099f380ac7ec737d8357fd9a9abf4c7a.zip |
UBlox: Only use time and date if flags are valid
Diffstat (limited to 'src/drivers/gps/ubx.cpp')
-rw-r--r-- | src/drivers/gps/ubx.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/drivers/gps/ubx.cpp b/src/drivers/gps/ubx.cpp index 96b26b699..09cd6b1c9 100644 --- a/src/drivers/gps/ubx.cpp +++ b/src/drivers/gps/ubx.cpp @@ -747,6 +747,10 @@ UBX::payload_rx_done(void) _gps_position->cog_rad = (float)_buf.payload_rx_nav_pvt.headMot * M_DEG_TO_RAD_F * 1e-5f; _gps_position->c_variance_rad = (float)_buf.payload_rx_nav_pvt.headAcc * M_DEG_TO_RAD_F * 1e-5f; + //Check if time and date fix flags are good + if( (_buf.payload_rx_nav_pvt.valid & UBX_RX_NAV_PVT_VALID_VALIDDATE) + && (_buf.payload_rx_nav_pvt.valid & UBX_RX_NAV_PVT_VALID_VALIDTIME) + && (_buf.payload_rx_nav_pvt.valid & UBX_RX_NAV_PVT_VALID_FULLYRESOLVED)) { /* convert to unix timestamp */ struct tm timeinfo; |