From 514a81296e1933ca69ba0feee710baa4ffd6ef57 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 17 Nov 2024 14:53:19 +0000 Subject: [PATCH] bugfix: NMEA GPS update rate was 0 since num_bytes_read was not being updated --- src/drivers/gps/gps.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index 004be4cc8b90..e35d3f5598f9 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -475,6 +475,9 @@ int GPS::pollOrRead(uint8_t *buf, size_t buf_length, int timeout) if (_interface == GPSHelper::Interface::UART) { ret = _uart.readAtLeast(buf, buf_length, math::min(character_count, buf_length), timeout_adjusted); + if (ret > 0) { + _num_bytes_read += ret; + } // SPI is only supported on LInux #if defined(__PX4_LINUX)