clean up PeriodicTask so I can eventually use it with a scheduler

This commit is contained in:
geeksville
2020-04-25 10:59:40 -07:00
parent 2061706c11
commit 64f6c0f5c0
8 changed files with 114 additions and 63 deletions

View File

@@ -27,6 +27,8 @@ GPS::GPS() : PeriodicTask() {}
void GPS::setup()
{
PeriodicTask::setup();
readFromRTC(); // read the main CPU RTC at first
#ifdef GPS_RX_PIN
@@ -114,12 +116,6 @@ void GPS::perhapsSetRTC(const struct timeval *tv)
#include <time.h>
// for the time being we need to rapidly read from the serial port to prevent overruns
void GPS::loop()
{
PeriodicTask::loop();
}
uint32_t GPS::getTime()
{
return ((millis() - timeStartMsec) / 1000) + zeroOffsetSecs;