aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Main.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-12-23 12:07:58 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-12-23 12:07:58 +0200
commit71ea5fcc1e5bb9f671b6cd5d7507e6689cdd535c (patch)
tree0326a5701a49877db5c831fe371c03766c4fde72 /Software/Embedded_SW/Embedded/Main.c
parent071a25b7bb2c03a6ae29fec70bd415ea89092dc4 (diff)
downloadTango-71ea5fcc1e5bb9f671b6cd5d7507e6689cdd535c.tar.gz
Tango-71ea5fcc1e5bb9f671b6cd5d7507e6689cdd535c.zip
fix FF reports, add time support for error log (and world time in the system), report regarding dispensers 50% and 25% LS
Diffstat (limited to 'Software/Embedded_SW/Embedded/Main.c')
-rw-r--r--Software/Embedded_SW/Embedded/Main.c11
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