]> rtime.felk.cvut.cz Git - arc.git/blobdiff - system/EcuM/EcuM_Main.c
EcuM/Mcu integration fixes
[arc.git] / system / EcuM / EcuM_Main.c
index 4cfdf2465898f850c3d696a94e5465ea1ac9f5c2..10a9aef2098742a94defd3b56fb3b5b8a444738e 100644 (file)
@@ -27,6 +27,7 @@
 #include "NvM.h"\r
 #endif\r
 \r
+\r
 static uint32 internal_data_run_state_timeout = 0;\r
 #if defined(USE_NVM)\r
 static uint32 internal_data_go_off_one_state_timeout = 0;\r
@@ -269,7 +270,7 @@ static inline void in_state_appRun(void){
                EcuM_OnExitRun();       /** @req EcuM2865 */\r
 \r
 #if defined(USE_WDGM)\r
-               // This is APPRUN not RUN.. so WdgM_SetMode() should not be called?\r
+               WdgM_SetMode(internal_data.config->EcuMWdgMConfig->EcuMWdgMPostRunMode);\r
 #endif\r
 \r
 #if defined(USE_RTE) && defined(CFG_ECUM_USE_SERVICE_COMPONENT)\r
@@ -339,9 +340,17 @@ static inline void in_state_goOffOne(void){
                // Wait for the NVM job (NvmWriteAll) to terminate\r
                NvM_GetErrorStatus(0, &writeAllResult);\r
                if ((writeAllResult != NVM_REQ_PENDING) || (internal_data_go_off_one_state_timeout == 0)){\r
+\r
+#if defined(USE_WDGM)\r
+                       WdgM_SetMode(internal_data.config->EcuMWdgMConfig->EcuMWdgMShutdownMode);\r
+#endif\r
                        ShutdownOS(E_OK);\r
                }\r
 #else\r
+\r
+#if defined(USE_WDGM)\r
+               WdgM_SetMode(internal_data.config->EcuMWdgMConfig->EcuMWdgMShutdownMode);\r
+#endif\r
                ShutdownOS(E_OK);\r
 #endif\r
 }\r