Mercurial > public > ostc4
changeset 414:6886aeeca454 Improment_NVM
Added compile switch for restoring of last known date after power lost:
In case timing date was lost the RTC has to be set to a proper time anyhow. Maybe this function does not add as much value as expected... => Added compile switch (deactivated) to allow easy reactivation if this function is wanted.
author | ideenmodellierer |
---|---|
date | Tue, 14 Jan 2020 21:38:45 +0100 |
parents | 65c7b009136f |
children | e0907c7d8038 |
files | Small_CPU/Src/scheduler.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Small_CPU/Src/scheduler.c Tue Jan 14 21:10:37 2020 +0100 +++ b/Small_CPU/Src/scheduler.c Tue Jan 14 21:38:45 2020 +0100 @@ -42,6 +42,8 @@ #include "decom.h" #include "tm_stm32f4_otp.h" +/* uncomment to enable restoting of last known date in case of a power loss (RTC looses timing data) */ +/* #define RESTORE_LAST_KNOWN_DATE */ #define INVALID_PREASURE_VALUE (100.0f) #define START_DIVE_MOUNTAIN_MODE_BAR (0.88f) @@ -1245,7 +1247,9 @@ if(global.deviceData.hoursOfOperation.value_int32 < DeviceDataFlash.hoursOfOperation.value_int32) { scheduleCopyDeviceData(&global.deviceData.hoursOfOperation, &DeviceDataFlash.hoursOfOperation); +#ifdef RESTORE_LAST_KNOWN_DATE scheduleCheckDate(); +#endif } if(global.deviceData.batteryChargeCompleteCycles.value_int32 < DeviceDataFlash.batteryChargeCompleteCycles.value_int32) {