aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Common/Utilities
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
committerMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
commit00a491d93733d4625ad329b2ba8237f445364b3f (patch)
tree4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Embedded_SW/Embedded/Common/Utilities
parent124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff)
downloadTango-00a491d9.tar.gz
Tango-00a491d9.zip
merge
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/Utilities')
-rw-r--r--Software/Embedded_SW/Embedded/Common/Utilities/Utils.c12
-rw-r--r--Software/Embedded_SW/Embedded/Common/Utilities/Utils.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
index d1143ada2..822294092 100644
--- a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
+++ b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
@@ -13,6 +13,7 @@
#include "driverlib/hibernate.h"
#include <driverlib/Watchdog.h>
#include <ti/sysbios/hal/Seconds.h>
+#include "drivers/Flash_ram/MCU_E2Prom.h"
//*****************************************************************************
@@ -137,16 +138,21 @@ void utilsInit(uint32_t ui32SysClock)
//
// HibernateCounterMode(HIBERNATE_COUNTER_24HR);
// Configure the hibernate module counter to RTC counter mode.
- HibernateCounterMode(HIBERNATE_COUNTER_RTC);
+ HibernateCounterMode(HIBERNATE_COUNTER_24HR);
-#define STARTTIME 1564403262
- Seconds_set(STARTTIME);
+//#define STARTTIME 1564403262
+// Seconds_set(STARTTIME);
}
void utilsUpdateDateTime(uint32_t StartTime)
{
Seconds_set(StartTime);
}
+void utilsStoreLocalTime()
+{
+ time_t time_store = umktime(&LocalTime);
+ MCU_E2PromProgram(EEPROM_LOCAL_TIME,time_store);
+}
uint32_t UsersysTickGet (void) {
uint32_t tick = 0;
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.h b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.h
index b54453e2c..779534182 100644
--- a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.h
+++ b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.h
@@ -23,6 +23,7 @@ typedef enum
void utilsInit(uint32_t ui32SysClock);
void utilsUpdateDateTime(uint32_t StartTime);
+void utilsStoreLocalTime(void);
uint32_t UsersysTickGet (void);
bool DanserCheckPosition(uint16_t position , Danser_t danser, bool test);
void InitWatchdog(uint32_t clock);