From caa0cf6ddf04e39bbcaf9d10cb4e77a1cbe226c3 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 7f3532097682b3..7067651ba5889d 100644 --- a/libraries/AP_GPS/AP_GPS_UBLOX.cpp +++ b/libraries/AP_GPS/AP_GPS_UBLOX.cpp @@ -1245,7 +1245,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; @@ -1858,7 +1858,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 b91cf9a7b1ad2b..7e1f0242482ba1 100644 --- a/libraries/AP_GPS/AP_GPS_UBLOX.h +++ b/libraries/AP_GPS/AP_GPS_UBLOX.h @@ -872,7 +872,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