mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
progress on keeping gps off more
This commit is contained in:
11
src/GPS.h
11
src/GPS.h
@@ -3,6 +3,7 @@
|
||||
#include <TinyGPS++.h>
|
||||
#include "PeriodicTask.h"
|
||||
#include "Observer.h"
|
||||
#include "sys/time.h"
|
||||
|
||||
/**
|
||||
* A gps class that only reads from the GPS periodically (and FIXME - eventually keeps the gps powered down except when reading)
|
||||
@@ -14,8 +15,11 @@ class GPS : public PeriodicTask, public Observable, public TinyGPSPlus
|
||||
public:
|
||||
GPS();
|
||||
|
||||
/// Return time since 1970 in msecs. Until we have a GPS lock we will be returning time based at zero
|
||||
uint64_t getTime();
|
||||
/// Return time since 1970 in secs. Until we have a GPS lock we will be returning time based at zero
|
||||
uint32_t getTime();
|
||||
|
||||
/// Return time since 1970 in secs. If we don't have a GPS lock return zero
|
||||
uint32_t getValidTime();
|
||||
|
||||
String getTimeStr();
|
||||
|
||||
@@ -25,6 +29,9 @@ public:
|
||||
|
||||
virtual void doTask();
|
||||
|
||||
/// If we haven't yet set our RTC this boot, set it from a GPS derived time
|
||||
void perhapsSetRTC(const struct timeval *tv);
|
||||
|
||||
private:
|
||||
void readFromRTC();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user