# HG changeset patch
# User ideenmodellierer
# Date 1579034325 -3600
# Node ID 6886aeeca454aab47f6597f5b2c93811a30dc01b
# Parent  65c7b009136f2a7b9db05d95b30c5b8f527f2e33
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.

diff -r 65c7b009136f -r 6886aeeca454 Small_CPU/Src/scheduler.c
--- 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)
 		{