aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Main.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-12-23 15:24:48 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-12-23 15:24:48 +0200
commitbd9bea9c2555a86fe092d5edb725867aadc64671 (patch)
tree0326a5701a49877db5c831fe371c03766c4fde72 /Software/Embedded_SW/Embedded/Main.c
parente57103400158c3cdff4983e6cdb41b194c9eee5e (diff)
parent71ea5fcc1e5bb9f671b6cd5d7507e6689cdd535c (diff)
downloadTango-bd9bea9c2555a86fe092d5edb725867aadc64671.tar.gz
Tango-bd9bea9c2555a86fe092d5edb725867aadc64671.zip
merge
Diffstat (limited to 'Software/Embedded_SW/Embedded/Main.c')
-rw-r--r--Software/Embedded_SW/Embedded/Main.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c
index 541fff0a7..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);
@@ -344,6 +354,10 @@ int main(void)
I2C_DispRFIDTask_Init();//I2C Task for dispensers & RFID
+#ifdef USE_UART4_FOR_BTSR
+ BTSR_Init();
+#endif
+
#if defined(USE_RFID_LOGIC) || defined(USE_RFID_STUB)
//Trigger_RFID_Init(); //Init_IFS();//must be done after FPGA_Init
Init_IFS();
@@ -367,7 +381,6 @@ int main(void)
#endif
CommunicationTaskInit();
- utilsInit(ui32SysClock);
#ifndef EVALUATION_BOARD
//Turn_the_Blower_On();//Turn on with the Default_Voltage