diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-12-24 16:20:59 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-12-24 16:20:59 +0200 |
| commit | 71f7f59a5345c2df5d2fa8c641a88bf1d12bf063 (patch) | |
| tree | bea86c782bb1a56cef3c824468680e8f0b9df476 /Software/Embedded_SW/Embedded/Main.c | |
| parent | 49251db3f95a2c3146fc94ef2d487042891a6220 (diff) | |
| parent | a7d02907a37ba35da13b03264ba5110bd08f83c1 (diff) | |
| download | Tango-71f7f59a5345c2df5d2fa8c641a88bf1d12bf063.tar.gz Tango-71f7f59a5345c2df5d2fa8c641a88bf1d12bf063.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Main.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Main.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index b42fca6e9..899143c36 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -13,6 +13,7 @@ */ #include <driverlib/sysctl.h> #include "driverlib/eeprom.h" +#include "driverlib/hibernate.h" #include "Drivers/USB_Communication/USBCDCD.h" #include "Drivers/I2C_Communication/I2C.h" @@ -168,6 +169,8 @@ Void errHook(Error_Block *eb) { FirstErrorFlag = false; MCU_E2PromProgram(EEPROM_INIT_FAILURE_COUNTER,InitFailures+1); + utilsStoreLocalTime(); + len = usnprintf(message, 300, "\r\nerror task 0x%x %s context prev task 0x%x,%s", PrevTask,Task_Handle_name(PrevTask),NextTask,Task_Handle_name(NextTask)); f_write(LogFileHandle,message,len,&Bytes ); site = Error_getSite(eb); @@ -234,6 +237,7 @@ void Init_EVB() int main(void) { FRESULT Fresult = FR_OK; + time_t time_store = 0; // Enable interrupts to the processor. // ROM_IntMasterDisable(); @@ -301,6 +305,13 @@ int main(void) #endif } + utilsInit(ui32SysClock); + MCU_E2PromRead(EEPROM_LOCAL_TIME,&time_store); + if (time_store) + { + ulocaltime(time_store+5,&LocalTime); + HibernateCalendarSet(&LocalTime); + } OpenLogFile(); Data = MCU_E2PromEmbeddedVersionRead(); memcpy (&Version,&Data,4); @@ -371,7 +382,6 @@ int main(void) #endif CommunicationTaskInit(); - utilsInit(ui32SysClock); #ifndef EVALUATION_BOARD //Turn_the_Blower_On();//Turn on with the Default_Voltage |
