diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-04 00:07:42 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-04 00:07:42 +0100 |
commit | 48a8ea7f199d44f02621767cdde1f50ae228b31e (patch) | |
tree | 91a97de486af1650fbab6acf28f5aa61af271151 /src/drivers/gps/ubx.cpp | |
parent | 470d35aca18104b54e26c37b97c86788e91cee67 (diff) | |
download | px4-firmware-48a8ea7f199d44f02621767cdde1f50ae228b31e.tar.gz px4-firmware-48a8ea7f199d44f02621767cdde1f50ae228b31e.tar.bz2 px4-firmware-48a8ea7f199d44f02621767cdde1f50ae228b31e.zip |
GPS driver: Fixed implicit cast causing time logic errors. Found by @Zefz
Diffstat (limited to 'src/drivers/gps/ubx.cpp')
-rw-r--r-- | src/drivers/gps/ubx.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/gps/ubx.cpp b/src/drivers/gps/ubx.cpp index 91ecdb474..5db3ced7c 100644 --- a/src/drivers/gps/ubx.cpp +++ b/src/drivers/gps/ubx.cpp @@ -828,8 +828,8 @@ UBX::payload_rx_done(void) ts.tv_nsec = _buf.payload_rx_nav_timeutc.nano; clock_settime(CLOCK_REALTIME, &ts); - _gps_position->time_gps_usec = (uint64_t)epoch * 1000000; //TODO: test this - _gps_position->time_gps_usec += (uint64_t)(_buf.payload_rx_nav_timeutc.nano * 1e-3f); + _gps_position->time_gps_usec = ((uint64_t)epoch) * 1000000ULL; + _gps_position->time_gps_usec += _buf.payload_rx_nav_timeutc.nano / 1000; } _gps_position->timestamp_time = hrt_absolute_time(); |