AP_GPS: rename UNIX_OFFSET

To keep consistency with other constants and make clear the unit.
This commit is contained in:
Lucas De Marchi 2017-02-11 01:26:18 -08:00
parent 30151c8253
commit 9f09442548
3 changed files with 3 additions and 3 deletions

View File

@ -611,7 +611,7 @@ AP_GPS::setHIL(uint8_t instance, GPS_Status _status, uint64_t time_epoch_ms,
istate.hdop = hdop;
istate.num_sats = _num_sats;
istate.last_gps_time_ms = tnow;
uint64_t gps_time_ms = time_epoch_ms - UNIX_OFFSET;
uint64_t gps_time_ms = time_epoch_ms - UNIX_OFFSET_MSEC;
istate.time_week = gps_time_ms / MSEC_PER_WEEK;
istate.time_week_ms = gps_time_ms - istate.time_week * MSEC_PER_WEEK;
timing[instance].last_message_time_ms = tnow;

View File

@ -34,7 +34,7 @@
// the number of GPS leap seconds
#define GPS_LEAPSECONDS_MILLIS 18000ULL
#define UNIX_OFFSET (17000ULL * 86400ULL + 52 * 10 * MSEC_PER_WEEK - GPS_LEAPSECONDS_MILLIS)
#define UNIX_OFFSET_MSEC (17000ULL * 86400ULL + 52 * 10 * MSEC_PER_WEEK - GPS_LEAPSECONDS_MILLIS)
class DataFlash_Class;
class AP_GPS_Backend;

View File

@ -63,7 +63,7 @@ int16_t AP_GPS_Backend::swap_int16(int16_t v) const
*/
uint64_t AP_GPS::time_epoch_convert(uint16_t gps_week, uint32_t gps_ms)
{
uint64_t fix_time_ms = UNIX_OFFSET + gps_week * MSEC_PER_WEEK + gps_ms;
uint64_t fix_time_ms = UNIX_OFFSET_MSEC + gps_week * MSEC_PER_WEEK + gps_ms;
return fix_time_ms;
}