fix cyclic time sync when no timesource seen yet
This commit is contained in:
parent
01011013fc
commit
817f7793c4
@ -22,6 +22,10 @@ void doHousekeeping() {
|
|||||||
if ((RTC_runmode == RUNMODE_UPDATE) || (RTC_runmode == RUNMODE_MAINTENANCE))
|
if ((RTC_runmode == RUNMODE_UPDATE) || (RTC_runmode == RUNMODE_MAINTENANCE))
|
||||||
do_reset(true); // warmstart
|
do_reset(true); // warmstart
|
||||||
|
|
||||||
|
// try to get time if we don't yet have a recent timesource
|
||||||
|
if (timeSource == _unsynced || timeSource == _set)
|
||||||
|
calibrateTime();
|
||||||
|
|
||||||
// print heap and task storage information
|
// print heap and task storage information
|
||||||
ESP_LOGD(TAG, "Heap: Free:%d, Min:%d, Size:%d, Alloc:%d, StackHWM:%d",
|
ESP_LOGD(TAG, "Heap: Free:%d, Min:%d, Size:%d, Alloc:%d, StackHWM:%d",
|
||||||
ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getHeapSize(),
|
ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getHeapSize(),
|
||||||
@ -49,11 +53,6 @@ void doHousekeeping() {
|
|||||||
if (GpsTask != NULL)
|
if (GpsTask != NULL)
|
||||||
ESP_LOGD(TAG, "Gpsloop %d bytes left | Taskstate = %d",
|
ESP_LOGD(TAG, "Gpsloop %d bytes left | Taskstate = %d",
|
||||||
uxTaskGetStackHighWaterMark(GpsTask), eTaskGetState(GpsTask));
|
uxTaskGetStackHighWaterMark(GpsTask), eTaskGetState(GpsTask));
|
||||||
// (only) while device time is not set or unsynched, and we have a valid
|
|
||||||
// GPS time, we call calibrateTime to poll time immeditately from GPS
|
|
||||||
if ((timeSource == _unsynced || timeSource == _set) &&
|
|
||||||
(gpstime.isUpdated() && gpstime.isValid() && gpstime.age() < 1000))
|
|
||||||
calibrateTime();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_SPI
|
#ifdef HAS_SPI
|
||||||
|
Loading…
Reference in New Issue
Block a user