mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 09:43:03 +00:00
More GPS work (#2711)
Increase GPS buffer on esp32 Check for and flush GPS buffer when overfilled and corrupted. Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
@@ -174,7 +174,7 @@ bool GPS::setupGPS()
|
||||
|
||||
#ifdef ARCH_ESP32
|
||||
// In esp32 framework, setRxBufferSize needs to be initialized before Serial
|
||||
_serial_gps->setRxBufferSize(2048); // the default is 256
|
||||
_serial_gps->setRxBufferSize(SERIAL_BUFFER_SIZE); // the default is 256
|
||||
#endif
|
||||
|
||||
// if the overrides are not dialled in, set them from the board definitions, if they exist
|
||||
@@ -834,6 +834,14 @@ void GPS::forceWake(bool on)
|
||||
}
|
||||
}
|
||||
|
||||
// clear the GPS rx buffer as quickly as possible
|
||||
void GPS::clearBuffer()
|
||||
{
|
||||
int x = _serial_gps->available();
|
||||
while (x--)
|
||||
_serial_gps->read();
|
||||
}
|
||||
|
||||
/// Prepare the GPS for the cpu entering deep or light sleep, expect to be gone for at least 100s of msecs
|
||||
int GPS::prepareSleep(void *unused)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user