diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-01 09:17:37 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-01 09:17:37 +0200 |
| commit | 1ed5320a2398745161685692342429e9af8518f2 (patch) | |
| tree | d812e6243c4617fe8386d0efc9915927adcab73b /Software/Embedded_SW/Embedded/Main.c | |
| parent | 06f6e9025818ff953151edbbffaeaa7959046482 (diff) | |
| download | Tango-1ed5320a2398745161685692342429e9af8518f2.tar.gz Tango-1ed5320a2398745161685692342429e9af8518f2.zip | |
reset notifications, IDS bug (skip pre run #4199)
Diffstat (limited to 'Software/Embedded_SW/Embedded/Main.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Main.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index cf99a9c03..45494e30e 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -12,6 +12,7 @@ #include <ti/sysbios/knl/Semaphore.h> */ #include <driverlib/sysctl.h> +#include "driverlib/eeprom.h" #include "Drivers/USB_Communication/USBCDCD.h" #include "Drivers/I2C_Communication/I2C.h" @@ -135,7 +136,20 @@ Void MyswitchFxn(Task_Handle prev, Task_Handle next) PrevTask = prev; NextTask = next; } +void updateresetreasonineeprom(void) +{ +#define Head_Address 40 +#define Max_Address 100 + int Head; + uint32_t RESC = SysCtlResetCauseGet(); + + EEPROMRead(&Head,Head_Address, 4); + if (Head>=Max_Address) Head=0; + Head++; + EEPROMProgram(&Head, Head_Address, 4); + EEPROMProgram(&RESC, Head_Address+Head, 4); +} /* ======== errHook ======== */ Void errHook(Error_Block *eb) { @@ -235,7 +249,7 @@ int main(void) // Enable interrupts to the processor. // ROM_IntMasterDisable(); - //Set the clock 120MHz + //Set the clock 120MHz uint32_t ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), SYS_CLK_FREQ); // Enable the system tick. @@ -253,6 +267,7 @@ int main(void) uint32_t Data,i; MCU_E2PromInit(); + updateresetreasonineeprom(); #endif #ifdef EVALUATION_BOARD |
