Forgot a part of the 1.3 fix

This commit is contained in:
Thomas Göttgens 2022-05-30 00:05:40 +02:00
parent 8e8158ebbc
commit 33fac6d0f5
4 changed files with 22 additions and 8 deletions

View File

@ -203,6 +203,11 @@ GPS::~GPS()
bool GPS::hasLock() { return hasValidLocation; }
bool GPS::hasFlow()
{
return hasGPS;
}
// Allow defining the polarity of the WAKE output. default is active high
#ifndef GPS_WAKE_ACTIVE
#define GPS_WAKE_ACTIVE 1
@ -342,7 +347,7 @@ int32_t GPS::runOnce()
} else {
#ifdef GPS_UBLOX
// reset the GPS on next bootup
if(devicestate.did_gps_reset && (millis() > 60000)) {
if(devicestate.did_gps_reset && (millis() > 60000) && !hasFlow()) {
DEBUG_MSG("GPS is not communicating, trying factory reset on next bootup.\n");
devicestate.did_gps_reset = false;
nodeDB.saveToDisk();

View File

@ -57,6 +57,9 @@ class GPS : private concurrency::OSThread
/// Returns true if we have acquired GPS lock.
virtual bool hasLock();
/// Returns true if there's valid data flow with the chip.
virtual bool hasFlow();
/// Return true if we are connected to a GPS
bool isConnected() const { return hasGPS; }

View File

@ -27,7 +27,7 @@ bool NMEAGPS::factoryReset()
_serial_gps->write(_message_reset,sizeof(_message_reset));
delay(1000);
#endif
return true;
return true;
}
bool NMEAGPS::setupGPS()
@ -235,6 +235,10 @@ bool NMEAGPS::hasLock()
return false;
}
bool NMEAGPS::hasFlow()
{
return reader.passedChecksum() > 0;
}
bool NMEAGPS::whileIdle()
{

View File

@ -51,4 +51,6 @@ class NMEAGPS : public GPS
virtual bool lookForLocation() override;
virtual bool hasLock() override;
virtual bool hasFlow() override;
};