From df43f9655d6f5f9d142d273d321d95b566fe6c4b Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Tue, 25 Jun 2024 17:11:16 +1000 Subject: [PATCH] AP_GPS: use 64 bit time in the pps interrupt callback --- libraries/AP_GPS/AP_GPS_UBLOX.cpp | 4 ++-- libraries/AP_GPS/AP_GPS_UBLOX.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_GPS/AP_GPS_UBLOX.cpp b/libraries/AP_GPS/AP_GPS_UBLOX.cpp index f9308b8fc3cdcc..4fe001a6669ab6 100644 --- a/libraries/AP_GPS/AP_GPS_UBLOX.cpp +++ b/libraries/AP_GPS/AP_GPS_UBLOX.cpp @@ -1286,7 +1286,7 @@ AP_GPS_UBLOX::_parse_gps(void) (unsigned)_buffer.nav_tp5.flags, (unsigned)_buffer.nav_tp5.freqPeriod); #ifdef HAL_GPIO_PPS - hal.gpio->attach_interrupt(HAL_GPIO_PPS, FUNCTOR_BIND_MEMBER(&AP_GPS_UBLOX::pps_interrupt, void, uint8_t, bool, uint32_t), AP_HAL::GPIO::INTERRUPT_FALLING); + hal.gpio->attach_interrupt(HAL_GPIO_PPS, FUNCTOR_BIND_MEMBER(&AP_GPS_UBLOX::pps_interrupt, void, uint8_t, bool, uint64_t), AP_HAL::GPIO::INTERRUPT_FALLING); #endif const uint16_t desired_flags = 0x003f; const uint16_t desired_period_hz = _pps_freq; @@ -1833,7 +1833,7 @@ AP_GPS_UBLOX::_parse_gps(void) */ #ifdef HAL_GPIO_PPS void -AP_GPS_UBLOX::pps_interrupt(uint8_t pin, bool high, uint32_t timestamp_us) +AP_GPS_UBLOX::pps_interrupt(uint8_t pin, bool high, uint64_t timestamp_us) { _last_pps_time_us = timestamp_us; } diff --git a/libraries/AP_GPS/AP_GPS_UBLOX.h b/libraries/AP_GPS/AP_GPS_UBLOX.h index 3bff854c325312..3b7085dc2ab356 100644 --- a/libraries/AP_GPS/AP_GPS_UBLOX.h +++ b/libraries/AP_GPS/AP_GPS_UBLOX.h @@ -873,7 +873,7 @@ class AP_GPS_UBLOX : public AP_GPS_Backend uint8_t _pps_freq = 1; #ifdef HAL_GPIO_PPS - void pps_interrupt(uint8_t pin, bool high, uint32_t timestamp_us); + void pps_interrupt(uint8_t pin, bool high, uint64_t timestamp_us); void set_pps_desired_freq(uint8_t freq) override; #endif