diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-02-06 15:22:42 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-02-06 15:22:42 +0200 |
| commit | 33c0ce2e46a6fca8b48396f8aab1150197af20f3 (patch) | |
| tree | 7a1c4d218d89b5ec612b2b4cad5cc70aa4a05d79 /Software/Embedded_SW/Embedded/Main.c | |
| parent | cbd8aeea982ba5541d19d13c441711d872dae316 (diff) | |
| download | Tango-33c0ce2e46a6fca8b48396f8aab1150197af20f3.tar.gz Tango-33c0ce2e46a6fca8b48396f8aab1150197af20f3.zip | |
read and handle version update (from MCU EEPROM)
Diffstat (limited to 'Software/Embedded_SW/Embedded/Main.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Main.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index 9469f9b97..d0ebb8274 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -47,6 +47,8 @@ #include "Drivers/USBStick_FileSys/USBstick.h" #include "Drivers/USBStick_FileSys/USBMSCHFatFs.h" */ +#include "Common/SW_Info/SW_Info.h" + #include "Modules/Control/control.h" #include "Modules/Control/MillisecTask.h" #include "Modules/Heaters/Heaters_ex.h" @@ -233,7 +235,19 @@ int main(void) //FlashInit(); #ifndef EVALUATION_BOARD + TangoVersion_t Version; + uint32_t Data; + MCU_E2PromInit(); + Data = MCU_E2PromEmbeddedVersionRead(); + memcpy (&Version,&Data,4); + if (memcmp(&Version,&_gTangoVersion,4)) + { + LOG_ERROR(Version.m_minor,"Version change, do stuff"); + FlashInit(); + MCU_E2PromEmbeddedVersionProgram(); + } + #endif #ifdef EVALUATION_BOARD Init_EVB(); |
