Skip to content

Commit

Permalink
bugfix: NMEA GPS update rate was 0 since num_bytes_read was not being… (
Browse files Browse the repository at this point in the history
PX4#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]>
  • Loading branch information
dronesalot and dakejahl authored Nov 18, 2024
1 parent 101384e commit b955588
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/drivers/gps/gps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit b955588

Please sign in to comment.