From 4f6d7e2c6386ed584a54a513c811cb77b5d320e1 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Thu, 19 Aug 2021 00:51:12 +0000 Subject: [PATCH] Move Backup to the system task. --- src/components/datetime/DateTimeController.cpp | 1 - src/components/datetime/DateTimeController.h | 1 - src/systemtask/SystemTask.cpp | 1 + src/systemtask/SystemTask.h | 1 + 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index 49953388..6e426825 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -76,7 +76,6 @@ void DateTime::UpdateTime(uint32_t systickCounter) { } else if (hour != 0) { isMidnightAlreadyNotified = false; } - NoInit_BackUpTime = currentDateTime; } const char* DateTime::MonthShortToString() { diff --git a/src/components/datetime/DateTimeController.h b/src/components/datetime/DateTimeController.h index a20f71c1..061c303f 100644 --- a/src/components/datetime/DateTimeController.h +++ b/src/components/datetime/DateTimeController.h @@ -2,7 +2,6 @@ #include #include -extern std::chrono::time_point NoInit_BackUpTime; namespace Pinetime { namespace System { diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 3553f449..add591e7 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -353,6 +353,7 @@ void SystemTask::Work() { monitor.Process(); uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); dateTimeController.UpdateTime(systick_counter); + NoInit_BackUpTime = dateTimeController.CurrentDateTime(); if (!nrf_gpio_pin_read(pinButton)) watchdog.Kick(); } diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index ba434298..9293fd78 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -30,6 +30,7 @@ #include "drivers/Watchdog.h" #include "Messages.h" +extern std::chrono::time_point NoInit_BackUpTime; namespace Pinetime { namespace Drivers { class Cst816S;