From b955588b26893287c45a59371de7d23d0e778e27 Mon Sep 17 00:00:00 2001 From: "S.W Develish" Date: Mon, 18 Nov 2024 01:16:50 +0000 Subject: [PATCH] =?UTF-8?q?bugfix:=20NMEA=20GPS=20update=20rate=20was=200?= =?UTF-8?q?=20since=20num=5Fbytes=5Fread=20was=20not=20being=E2=80=A6=20(#?= =?UTF-8?q?23957)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bugfix: NMEA GPS update rate was 0 since num_bytes_read was not being updated * Update gps.cpp style fix * make format --------- Co-authored-by: Jacob Dahl --- src/drivers/gps/gps.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index 004be4cc8b..aeeba755e3 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -476,6 +476,10 @@ 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)