diff options
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 |
