Browse Source

SITL: Use the GPS_LEAPSECOND define

mission-4.1.18
Michael du Breuil 8 years ago committed by Francisco Ferreira
parent
commit
d5a5a97a3d
  1. 2
      libraries/AP_HAL_SITL/sitl_gps.cpp

2
libraries/AP_HAL_SITL/sitl_gps.cpp

@ -177,7 +177,7 @@ static void gps_time(uint16_t *time_week, uint32_t *time_week_ms) @@ -177,7 +177,7 @@ static void gps_time(uint16_t *time_week, uint32_t *time_week_ms)
{
struct timeval tv;
simulation_timeval(&tv);
const uint32_t epoch = 86400*(10*365 + (1980-1969)/4 + 1 + 6 - 2) - 15;
const uint32_t epoch = 86400*(10*365 + (1980-1969)/4 + 1 + 6 - 2) - (GPS_LEAPSECONDS_MILLIS / 1000ULL);
uint32_t epoch_seconds = tv.tv_sec - epoch;
*time_week = epoch_seconds / (86400*7UL);
uint32_t t_ms = tv.tv_usec / 1000;

Loading…
Cancel
Save