diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-11-17 14:39:41 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-11-17 14:39:41 +0200 |
| commit | 0d836ced3dbe4a31916064bdf89fe1c8283c011f (patch) | |
| tree | 6f7b0545148fd8e52ed49e1bfd6e473a690899a0 /Software/Embedded_SW/Embedded/Main.c | |
| parent | e29b3fcf2531b0c50cf1707e552ba72baa060800 (diff) | |
| download | Tango-0d836ced3dbe4a31916064bdf89fe1c8283c011f.tar.gz Tango-0d836ced3dbe4a31916064bdf89fe1c8283c011f.zip | |
Version 1.5.2(1): fix some bugs. improve / fix Update Pid during run, and cartridge state
Diffstat (limited to 'Software/Embedded_SW/Embedded/Main.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Main.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index c1d83abb3..ed1ecbefa 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -182,8 +182,8 @@ Void errHook(Error_Block *eb) System_printf("assertion violation: "); f_write(LogFileHandle,"\r\nassertion violation: ",22,&Bytes ); } + CloseLogFile(); } - CloseLogFile(); #ifdef WATCHDOG @@ -222,6 +222,7 @@ void Init_EVB() int main(void) { + FRESULT Fresult = FR_OK; // Enable interrupts to the processor. // ROM_IntMasterDisable(); @@ -255,6 +256,39 @@ int main(void) LOG_ERROR (iFResult, "Error during init Flash File System"); assert(iFResult); } + Fresult = f_mkdir("0://SysInfo"); + if ((Fresult != FR_OK)&&(Fresult != FR_EXIST)) + { +#ifdef WATCHDOG + ROM_WatchdogResetDisable(WATCHDOG0_BASE); + uint32_t timeout = 0xFFFFFFFFU; + ROM_WatchdogReloadSet(WATCHDOG0_BASE, timeout); +#endif + STATUS_GREEN_LED_ON; + ACTIVITY_GREEN_LED_ON; + COMM_GREEN_LED_ON; + + STATUS_RED_LED_ON; + ACTIVITY_RED_LED_ON; + COMM_RED_LED_ON; + //FFS error + Report("FFS error - rebuilding", __FILE__,__LINE__,Fresult, RpMessage,0, 0); + FRESULT iFResult = Init_Flash_File_System(true);// true + Fresult = f_mkdir("0://SysInfo"); + + ACTIVITY_GREEN_LED_OFF; + COMM_GREEN_LED_OFF; + + STATUS_RED_LED_OFF; + ACTIVITY_RED_LED_OFF; + COMM_RED_LED_OFF; +#ifdef WATCHDOG + ROM_WatchdogResetEnable(WATCHDOG0_BASE); + timeout = 120000000*3; + ROM_WatchdogReloadSet(WATCHDOG0_BASE, timeout); +#endif + } + OpenLogFile(); Data = MCU_E2PromEmbeddedVersionRead(); memcpy (&Version,&Data,4); |
