fix #327 always factory reset the GPS once

This commit is contained in:
geeksville
2020-08-21 10:14:03 -07:00
parent 6a359e2124
commit d7a1cef046
4 changed files with 83 additions and 41 deletions
+12 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#include "../concurrency/PeriodicTask.h"
#include "GPS.h"
#include "Observer.h"
#include "../concurrency/PeriodicTask.h"
#include "SparkFun_Ublox_Arduino_Library.h"
/**
@@ -33,12 +33,22 @@ class UBloxGPS : public GPS, public concurrency::PeriodicTask
* called after the CPU wakes from light-sleep state */
virtual void startLock();
private:
/**
* Reset our GPS back to factory settings
*
* @return true for success
*/
bool factoryReset();
private:
/// Prepare the GPS for the cpu entering deep or light sleep, expect to be gone for at least 100s of msecs
/// always returns 0 to indicate okay to sleep
int prepareSleep(void *unused);
/// Attempt to connect to our GPS, returns false if no gps is present
bool tryConnect();
/// Switch to our desired operating mode and save the settings to flash
/// returns true for success
bool setUBXMode();
};