diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/Main.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Main.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index b42fca6e9..6b2878677 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -168,6 +168,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 +236,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 +304,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 +381,6 @@ int main(void) #endif CommunicationTaskInit(); - utilsInit(ui32SysClock); #ifndef EVALUATION_BOARD //Turn_the_Blower_On();//Turn on with the Default_Voltage |
