Merge branch 'master' into radiolib-sync-upstream

This commit is contained in:
Kevin Hester 2021-09-04 18:07:55 -07:00 committed by GitHub
commit c8269d67c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -80,6 +80,8 @@ GPS::~GPS()
notifyDeepSleepObserver.unobserve(); notifyDeepSleepObserver.unobserve();
} }
bool GPS::hasLock() { return hasValidLocation; }
// Allow defining the polarity of the WAKE output. default is active high // Allow defining the polarity of the WAKE output. default is active high
#ifndef GPS_WAKE_ACTIVE #ifndef GPS_WAKE_ACTIVE
#define GPS_WAKE_ACTIVE 1 #define GPS_WAKE_ACTIVE 1

View File

@ -57,8 +57,8 @@ class GPS : private concurrency::OSThread
*/ */
virtual bool setup(); virtual bool setup();
/// Returns ture if we have acquired GPS lock. /// Returns true if we have acquired GPS lock.
bool hasLock() const { return hasValidLocation; } virtual bool hasLock();
/// Return true if we are connected to a GPS /// Return true if we are connected to a GPS
bool isConnected() const { return hasGPS; } bool isConnected() const { return hasGPS; }

View File

@ -196,6 +196,11 @@ bool UBloxGPS::lookForLocation()
return foundLocation; return foundLocation;
} }
bool UBloxGPS::hasLock()
{
return (fixType >= 3 && fixType <= 4);
}
bool UBloxGPS::whileIdle() bool UBloxGPS::whileIdle()
{ {
// if using i2c or serial look too see if any chars are ready // if using i2c or serial look too see if any chars are ready

View File

@ -54,6 +54,7 @@ class UBloxGPS : public GPS
* @return true if we've acquired a new location * @return true if we've acquired a new location
*/ */
virtual bool lookForLocation(); virtual bool lookForLocation();
virtual bool hasLock();
/// If possible force the GPS into sleep/low power mode /// If possible force the GPS into sleep/low power mode
virtual void sleep(); virtual void sleep();