Skip to content

Commit b955588

Browse files
dronesalotdakejahl
andauthored
bugfix: NMEA GPS update rate was 0 since num_bytes_read was not being… (#23957)
* 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 <[email protected]>
1 parent 101384e commit b955588

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/drivers/gps/gps.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ int GPS::pollOrRead(uint8_t *buf, size_t buf_length, int timeout)
476476
if (_interface == GPSHelper::Interface::UART) {
477477
ret = _uart.readAtLeast(buf, buf_length, math::min(character_count, buf_length), timeout_adjusted);
478478

479+
if (ret > 0) {
480+
_num_bytes_read += ret;
481+
}
482+
479483
// SPI is only supported on LInux
480484
#if defined(__PX4_LINUX)
481485

0 commit comments

Comments
 (0)