Move Backup to the system task.
This commit is contained in:
parent
2dd7b8ba2c
commit
4f6d7e2c63
|
@ -76,7 +76,6 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
|
||||||
} else if (hour != 0) {
|
} else if (hour != 0) {
|
||||||
isMidnightAlreadyNotified = false;
|
isMidnightAlreadyNotified = false;
|
||||||
}
|
}
|
||||||
NoInit_BackUpTime = currentDateTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* DateTime::MonthShortToString() {
|
const char* DateTime::MonthShortToString() {
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
extern std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> NoInit_BackUpTime;
|
|
||||||
|
|
||||||
namespace Pinetime {
|
namespace Pinetime {
|
||||||
namespace System {
|
namespace System {
|
||||||
|
|
|
@ -353,6 +353,7 @@ void SystemTask::Work() {
|
||||||
monitor.Process();
|
monitor.Process();
|
||||||
uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG);
|
uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG);
|
||||||
dateTimeController.UpdateTime(systick_counter);
|
dateTimeController.UpdateTime(systick_counter);
|
||||||
|
NoInit_BackUpTime = dateTimeController.CurrentDateTime();
|
||||||
if (!nrf_gpio_pin_read(pinButton))
|
if (!nrf_gpio_pin_read(pinButton))
|
||||||
watchdog.Kick();
|
watchdog.Kick();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "drivers/Watchdog.h"
|
#include "drivers/Watchdog.h"
|
||||||
#include "Messages.h"
|
#include "Messages.h"
|
||||||
|
|
||||||
|
extern std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> NoInit_BackUpTime;
|
||||||
namespace Pinetime {
|
namespace Pinetime {
|
||||||
namespace Drivers {
|
namespace Drivers {
|
||||||
class Cst816S;
|
class Cst816S;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user