mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 03:00:56 +00:00
Triple-press not disabling GPS (#4041)
* Replace (bool) isAwake with an enum, to track standby states
* Tidy-up, extra logging
* Rename enum values
* Reorder GPSPowerState enum
Possibly more intuitive when reading logs
* Avoid lego comments
de22c57298 (r1627334779)
This commit is contained in:
@@ -38,6 +38,12 @@ typedef enum {
|
||||
GNSS_RESPONSE_OK,
|
||||
} GPS_RESPONSE;
|
||||
|
||||
enum GPSPowerState : uint8_t {
|
||||
GPS_OFF = 0,
|
||||
GPS_AWAKE = 1,
|
||||
GPS_STANDBY = 2,
|
||||
};
|
||||
|
||||
// Generate a string representation of DOP
|
||||
const char *getDOPString(uint32_t dop);
|
||||
|
||||
@@ -78,8 +84,6 @@ class GPS : private concurrency::OSThread
|
||||
*/
|
||||
bool hasValidLocation = false; // default to false, until we complete our first read
|
||||
|
||||
bool isAwake = false; // true if we want a location right now
|
||||
|
||||
bool isInPowersave = false;
|
||||
|
||||
bool shouldPublish = false; // If we've changed GPS state, this will force a publish the next loop()
|
||||
@@ -89,6 +93,8 @@ class GPS : private concurrency::OSThread
|
||||
bool GPSInitFinished = false; // Init thread finished?
|
||||
bool GPSInitStarted = false; // Init thread finished?
|
||||
|
||||
GPSPowerState powerState = GPS_OFF; // GPS_AWAKE if we want a location right now
|
||||
|
||||
uint8_t numSatellites = 0;
|
||||
|
||||
CallbackObserver<GPS, void *> notifyDeepSleepObserver = CallbackObserver<GPS, void *>(this, &GPS::prepareDeepSleep);
|
||||
|
||||
Reference in New Issue
Block a user