--- /dev/null
+/* -------------------------------- Arctic Core ------------------------------\r
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
+ *\r
+ * Copyright (C) 2009 ArcCore AB <contact@arccore.com>\r
+ *\r
+ * This source code is free software; you can redistribute it and/or modify it\r
+ * under the terms of the GNU General Public License version 2 as published by the\r
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\r
+ * for more details.\r
+ * -------------------------------- Arctic Core ------------------------------*/\r
+\r
+#ifndef WDG_CFG_H_\r
+#define WDG_CFG_H_\r
+\r
+#include "Std_Types.h"\r
+#include "WdgIf_Types.h"\r
+\r
+typedef struct\r
+{\r
+ uint32 ReloadValue;\r
+ uint8 ActivationBit;\r
+}Wdg_SettingsType;\r
+\r
+typedef struct\r
+{\r
+ WdgIf_ModeType Wdg_DefaultMode;\r
+ Wdg_SettingsType WdgSettingsFast;\r
+ Wdg_SettingsType WdgSettingsSlow;\r
+ Wdg_SettingsType WdgSettingsOff;\r
+}Wdg_ModeConfigType;\r
+\r
+typedef struct\r
+{\r
+ const Wdg_GeneralType *Wdg_General;\r
+ const Wdg_ModeConfigType *Wdg_ModeConfig;\r
+}Wdg_ConfigType;\r
+\r
+ extern const Wdg_GeneralType WdgGeneral;\r
+ extern const Wdg_ConfigType WdgConfig;\r
+\r
+#endif /* WDG_CFG_H_ */\r
--- /dev/null
+/* -------------------------------- Arctic Core ------------------------------\r
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
+ *\r
+ * Copyright (C) 2009 ArcCore AB <contact@arccore.com>\r
+ *\r
+ * This source code is free software; you can redistribute it and/or modify it\r
+ * under the terms of the GNU General Public License version 2 as published by the\r
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\r
+ * for more details.\r
+ * -------------------------------- Arctic Core ------------------------------*/\r
+\r
+#include "Wdg.h"\r
+\r
+const Wdg_ModeConfigType WdgModeConfig =\r
+{\r
+ .Wdg_DefaultMode = WDGIF_OFF_MODE,\r
+ .WdgSettingsFast =\r
+ {\r
+ .ReloadValue = 0x200,\r
+ .ActivationBit = 1,\r
+ },\r
+ .WdgSettingsSlow =\r
+ {\r
+ .ReloadValue = 0x7D00,\r
+ .ActivationBit = 1,\r
+ },\r
+ .WdgSettingsOff =\r
+ {\r
+ .ReloadValue = 0x7D00,\r
+ .ActivationBit = 0,\r
+ },\r
+};\r
+\r
+const Wdg_GeneralType WdgGeneral =\r
+{\r
+ .Wdg_Index = 1,\r
+ .Wdg_TriggerLocationPtr = Wdg_Trigger,\r
+ .Wdg_SetModeLocationPtr = Wdg_SetMode,\r
+};\r
+\r
+\r
+const Wdg_ConfigType WdgConfig =\r
+{\r
+ .Wdg_General = &WdgGeneral,\r
+ .Wdg_ModeConfig = &WdgModeConfig,\r
+};\r
+\r
+\r
const float32 WdgM_TriggerCycle;\r
}WdgM_ActivationSchMType;\r
\r
+#if (WDGM_GPT_USED == STD_ON)\r
typedef struct\r
{\r
const uint32 WdgM_GptCycle;\r
const Gpt_ChannelType WdgM_GptChannelRef;\r
}WdgM_ActivationGPTType;\r
+#endif\r
\r
typedef struct\r
{\r
const boolean WdgM_IsGPTActivated;\r
const WdgM_ActivationSchMType WdgM_ActivationSchM;\r
+#if (WDGM_GPT_USED == STD_ON)\r
const WdgM_ActivationGPTType WdgM_ActivationGPT;\r
+#endif\r
}WdgM_ActivationType;\r
\r
typedef struct\r
SchM_Init();\r
#endif\r
\r
+#if defined(USE_WDGM)\r
+ WdgM_SetMode(internal_data.config->EcuMWdgMConfig->EcuMWdgMStartupMode);\r
+#endif\r
+\r
// Initialize drivers that don't need NVRAM data\r
EcuM_AL_DriverInitTwo(internal_data.config);\r
\r
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
// 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