* Configuration of module EcuM (EcuM_Callout_template.c)
*
* Created by:
-* Configured for (MCU): MPC5567
+* Configured for (MCU):
*
* Module editor vendor: ArcCore
* Module editor version: 2.0.0
* Configuration of module EcuM (EcuM_Cfg.c)
*
* Created by:
-* Configured for (MCU): MPC5567
+* Configured for (MCU):
*
* Module editor vendor: ArcCore
* Module editor version: 2.0.0
* Generated by Arctic Studio (http://arccore.com)
* on Tue May 25 11:41:52 CEST 2010
*/
-
-\r
\r
#warning "This default file may only be used as an example!"
.EcuMDefaultShutdownTarget = ECUM_STATE_RESET,\r
.EcuMDefaultShutdownMode = 0, // Don't care\r
.EcuMDefaultAppMode = OSDEFAULTAPPMODE,\r
- .EcuMNvramReadAllTimeout = 10000,
- .EcuMNvramWriteAllTimeout = 10000,
- .EcuMRunSelfRequestPeriod = 10000,
+ .EcuMNvramReadAllTimeout = ECUM_NVRAM_READALL_TIMEOUT,
+ .EcuMNvramWriteAllTimeout = ECUM_NVRAM_WRITEALL_TIMEOUT,
+ .EcuMRunMinimumDuration = ECUM_NVRAM_MIN_RUN_DURATION,
\r
#if defined(USE_MCU)\r
.McuConfig = McuConfigData,\r
.PwmConfig = &PwmConfig,\r
#endif\r
#if defined(USE_GPT)\r
- .GptConfig = GptConfigData,\r
+ .GptConfig = GptConfigData,\r
#endif\r
#if defined(USE_FLS)
.FlashConfig = FlsConfigSet,
* Configuration of module EcuM (EcuM_Cfg.h)\r
*\r
* Created by: \r
- * Configured for (MCU): MPC5567\r
+ * Configured for (MCU):\r
*\r
* Module vendor: ArcCore\r
* Module version: 2.0.0\r
#define ECUM_CFG_H_\r
\r
#define ECUM_VERSION_INFO_API STD_ON\r
-#define ECUM_INCLUDE_NVRAM_MGR STD_OFF\r
#define ECUM_DEV_ERROR_DETECT STD_ON\r
\r
#include "EcuM_Generated_Types.h"\r
\r
-#define ECUM_MAIN_FUNCTION_PERIOD 200\r
+#define ECUM_MAIN_FUNCTION_PERIOD (200)\r
+#define ECUM_NVRAM_READALL_TIMEOUT (10000)\r
+#define ECUM_NVRAM_WRITEALL_TIMEOUT (10000)\r
+#define ECUM_NVRAM_MIN_RUN_DURATION (10000)\r
\r
// EcuM_UserType definitions\r
typedef enum {\r
+ ECUM_USER_SYSTEM, // Dummy user to get at least one user in system\r
ECUM_USER_ENDMARK // Must be the last in list!\r
} EcuM_UserList;\r
\r
* Configuration of module EcuM (EcuM_Generated_Types.h)
*
* Created by:
-* Configured for (MCU): MPC5567
+* Configured for (MCU):
*
* Module editor vendor: ArcCore
* Module editor version: 2.0.0
EcuM_StateType EcuMDefaultShutdownTarget;\r
uint8 EcuMDefaultShutdownMode;\r
AppModeType EcuMDefaultAppMode;\r
- uint32 EcuMRunSelfRequestPeriod;
+ uint32 EcuMRunMinimumDuration;
uint32 EcuMNvramReadAllTimeout;
uint32 EcuMNvramWriteAllTimeout;
\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
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-\r
-/* Link time config */\r
-\r
-#warning "This default file may only be used as an example!"\r
-\r
-#include "Std_Types.h"\r
-#include "Os.h"\r
-#include "Mcu.h"\r
-#include "Gpt.h"\r
-#include <assert.h>\r
-#include "Cpu.h"\r
-\r
-//#include "ComM.h"\r
-//#include "WdgM.h"\r
-\r
-//#include "Dem.h"\r
-//#include "Det.h"\r
-//#include "NvM.h"\r
-//#include "rte.h"\r
-\r
-extern void os_exception_IVPR();\r
-extern void os_exception_IVOR10();\r
-// The OS startup hook\r
-\r
-#if 0\r
-void StartupHook( void ) {\r
-\r
- // There a several things we need to connect here\r
- // * counter id for the system counter is 0\r
- // * that need to be attached to Gpt\r
- // --> We need to tell the OS that what Gpt channel it's\r
- // counter is connected to.\r
-\r
- // TODO: We need counter information here..\r
- // How do I get that information from the OS???\r
-\r
- //? GetCounterAlarmBase()\r
-\r
-// Gpt_StartTimer(GPT_CHANNEL_DEC, 100 );\r
-// Gpt_EnableNotification(GPT_CHANNEL_DEC);\r
-// Gpt_SetMode(0);\r
-}\r
-#endif\r
-\r
-extern void os_system_timer( void );\r
-\r
-void EcuM_Init( void );\r
-int main( void ) {\r
-\r
- EcuM_Init();\r
- return 0;\r
-}\r
-\r
-void EcuM_Init( void ) {\r
- /* Call all mandatory interfaces, see 8.7.1 */\r
-\r
- /* I'm giving up on the MCU configuration. From what I\r
- * can tell from the documentation the Mcu_Init()\r
- */\r
-\r
-#if 0\r
- ComM_ConfigType comMConfig;\r
- WdgM_ConfigType wdgmConfig;\r
-#endif\r
-\r
-// Startup I\r
- {\r
- const Mcu_ConfigType mcuConfig;\r
- Mcu_Init(&mcuConfig);\r
- }\r
-// Mcu_GetResetReason();\r
-#if 0\r
- Det_Init();\r
-#if defined(USE_DEM)\r
- Dem_PreInit();\r
-#endif\r
- EcuM_AL_DriverInitOne();\r
-#endif\r
-\r
-\r
- {\r
- // If we assume the OS will require SYSTEM_COUNTER to function.\r
- // We should either get the values from SYSTEM_COUNTER\r
-\r
- Gpt_ConfigType GptConfigData[] =\r
- { {\r
- .GptChannelId = GPT_CHANNEL_DEC,\r
- .GptChannelMode = GPT_MODE_CONTINUOUS,\r
- .GptChannelClkSrc = 0,\r
- .GptNotification = os_system_timer,\r
- }\r
- };\r
- Gpt_Init(&GptConfigData[0]);\r
-\r
- // The timer is actually started in StartupHook()\r
- }\r
-\r
-\r
-// EcuM_SelectShutdownTarget(target,mode);\r
- StartOS(OSDEFAULTAPPMODE);\r
-// Startup II\r
- //EcuM_AL_DriverInitTwo();\r
-\r
-#if 0\r
- ComM_Init(&comMConfig);\r
- WdgM_Init(&wdgmConfig);\r
- NvM_Init();\r
- NvM_ReadAll();\r
- NvM_WriteAll();\r
- NvM_CancelWriteAll();\r
-\r
-#if defined(USE_DEM)\r
- Dem_PreInit();\r
- Dem_Init();\r
- {\r
- Dem_EventIdType id = 0;\r
- Dem_EventStatusType status = 0;\r
- Dem_ReportErrorStatus(id,status);\r
- }\r
-#endif\r
- Rte_Start();\r
- Rte_Stop();\r
-#endif\r
-\r
- ShutdownOS(E_OK);\r
- EnableAllInterrupts();\r
- DisableAllInterrupts();\r
-\r
-// Det_ReportError(1,2,3,4);\r
-}\r
-\r
-void EcuM_Shutdown( void ) {\r
-\r
-}\r
-\r
-void EcuM_GetVersionInfo( Std_VersionInfoType *versioninfo ) {\r
-\r
-}\r
-\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Callout_template.c)\r
-* \r
-* Created by: \r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* \r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 14:42:38 CEST 2010\r
-*/\r
-\r
-\r
-#include "EcuM.h"\r
-#include "Det.h"\r
-#if defined(USE_DEM)\r
-#include "Dem.h"\r
-#endif\r
-#if defined(USE_MCU)\r
-#include "Mcu.h"\r
-#endif\r
-#if defined(USE_GPT)\r
-#include "Gpt.h"\r
-#endif\r
-#if defined(USE_CAN)\r
-#include "Can.h"\r
-#endif\r
-#if defined(USE_CANIF)\r
-#include "CanIf.h"\r
-#endif\r
-#if defined(USE_PDUR)\r
-#include "PduR.h"\r
-#endif\r
-#if defined(USE_COM)\r
-#include "Com.h"\r
-#endif\r
-#if defined(USE_CANTP)\r
-#include "CanTp.h"\r
-#endif\r
-#if defined(USE_DCM)\r
-#include "Dcm.h"\r
-#endif\r
-#if defined(USE_PWM)\r
-#include "Pwm.h"\r
-#endif\r
-#if defined(USE_IOHWAB)\r
-#include "IoHwAb.h"\r
-#endif\r
-\r
-void EcuM_AL_DriverInitZero()\r
-{\r
- Det_Init();\r
- Det_Start();\r
-}\r
-\r
-EcuM_ConfigType* EcuM_DeterminePbConfiguration()\r
-{\r
- return &EcuMConfig;\r
-}\r
-\r
-void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)\r
-{\r
-#if defined(USE_MCU)\r
- Mcu_Init(ConfigPtr->McuConfig);\r
-\r
- // Set up default clock (Mcu_InitClock requires initRun==1)\r
- Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings );\r
-\r
- // Wait for PLL to sync.\r
- while (Mcu_GetPllStatus() != MCU_PLL_LOCKED)\r
- ;\r
-#endif\r
-\r
-#if defined(USE_DEM)\r
- // Preinitialize DEM\r
- Dem_PreInit();\r
-#endif\r
-\r
-#if defined(USE_PORT)\r
- // Setup Port\r
- Port_Init(ConfigPtr->PortConfig);\r
-#endif\r
-\r
-\r
-#if defined(USE_GPT)\r
- // Setup the GPT\r
- Gpt_Init(ConfigPtr->GptConfig);\r
-#endif\r
-\r
- // Setup watchdog\r
- // TODO\r
-\r
-#if defined(USE_DMA)\r
- // Setup DMA\r
- Dma_Init(ConfigPtr->DmaConfig);\r
-#endif\r
-\r
-#if defined(USE_ADC)\r
- // Setup ADC\r
- Adc_Init(ConfigPtr->AdcConfig);\r
-#endif\r
-\r
- // Setup ICU\r
- // TODO\r
-\r
- // Setup PWM\r
-#if defined(USE_PWM)\r
- // Setup PWM\r
- Pwm_Init(ConfigPtr->PwmConfig);\r
-#endif\r
-}\r
-\r
-void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)\r
-{\r
-#if defined(USE_SPI)\r
- // Setup SPI\r
- Spi_Init(ConfigPtr->SpiConfig);\r
-#endif\r
-\r
-#if defined(USE_EEP)\r
- // Setup EEP\r
- Eep_Init(ConfigPtr->EEpConfig);\r
-#endif\r
-\r
-#if defined(USE_FLS)\r
- // Setup Flash\r
- FlashInit(ConfigPtr->FlashConfig);\r
-#endif\r
-\r
- // Setup NVRAM Manaager\r
- // TODO\r
-\r
- // Setup CAN tranceiver\r
- // TODO\r
-\r
-#if defined(USE_CAN)\r
- // Setup Can driver\r
- Can_Init(ConfigPtr->CanConfig);\r
-#endif\r
-\r
-#if defined(USE_CANIF)\r
- // Setup CanIf\r
- CanIf_Init(ConfigPtr->CanIfConfig);\r
-#endif\r
-\r
-#if defined(USE_CANTP)\r
- // Setup CAN TP\r
- CanTp_Init();\r
-#endif\r
- // Setup LIN\r
- // TODO\r
-\r
-#if defined(USE_PDUR)\r
- // Setup PDU Router\r
- PduR_Init(ConfigPtr->PduRConfig);\r
-#endif\r
-\r
-#if defined(USE_COM)\r
- // Setup COM layer\r
- Com_Init(ConfigPtr->ComConfig);\r
-#endif\r
-\r
-#if defined(USE_DCM)\r
- // Setup DCM\r
- Dcm_Init();\r
-#endif\r
-\r
-#if defined(USE_IOHWAB)\r
- // Setup IO hardware abstraction layer\r
- IoHwAb_Init();\r
-#endif\r
-\r
-}\r
-\r
-void EcuM_AL_DriverInitThree(const EcuM_ConfigType ConfigPtr)\r
-{\r
-#if defined(USE_DEM)\r
- // Setup DEM\r
- Dem_Init();\r
-#endif\r
-\r
-#if defined(USE_CANIF)\r
- // Startup the CAN interafce; due to the missing COM manager\r
- CanIf_InitController(CANIF_CHANNEL_0, CANIF_CHANNEL_0_CONFIG_0);\r
- CanIf_SetControllerMode(CANIF_CHANNEL_0, CANIF_CS_STARTED);\r
-#endif\r
-}\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Cfg.c)\r
-* \r
-* Created by: \r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* \r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 14:42:38 CEST 2010\r
-*/\r
-\r
-\r
-\r
-#include "EcuM.h"\r
-\r
-EcuM_ConfigType EcuMConfig =\r
-{\r
- .EcuMDefaultShutdownTarget = ECUM_STATE_RESET,\r
- .EcuMDefaultShutdownMode = 0, // Don't care\r
- .EcuMDefaultAppMode = 0, // Don't care\r
-\r
-#if defined(USE_MCU)\r
- .McuConfig = McuConfigData,\r
-#endif\r
-#if defined(USE_PORT)\r
- .PortConfig = &PortConfigData,\r
-#endif\r
-#if defined(USE_CAN)\r
- .CanConfig = &CanConfigData,\r
-#endif\r
-#if defined(USE_CANIF)\r
- .CanIfConfig = &CanIf_Config,\r
-#endif\r
-#if defined(USE_COM)\r
- .ComConfig = &ComConfiguration,\r
-#endif\r
-#if defined(USE_PDUR)\r
- .PduRConfig = &PduR_Config,\r
-#endif\r
-#if defined(USE_DMA)\r
- .DmaConfig = DmaConfig,\r
-#endif\r
-#if defined(USE_ADC)\r
- .AdcConfig = AdcConfig,\r
-#endif\r
-#if defined(USE_PWM)\r
- .PwmConfig = &PwmConfig,\r
-#endif\r
-#if defined(USE_GPT)\r
- .GptConfig = GptConfigData,\r
-#endif\r
-};\r
-\r
-void EcuM_OnGoOffTwo( void ) {\r
-\r
-}\r
-\r
-void EcuM_AL_SwitchOff( void ) {\r
-\r
-}\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Cfg.h)\r
-* \r
-* Created by: \r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* \r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 15:56:33 CEST 2010\r
-*/\r
-\r
-\r
-#if (ECUM_SW_MAJOR_VERSION != 1) \r
-#error "EcuM: Configuration file version differs from BSW version."\r
-#endif\r
-\r
-\r
-\r
-#ifndef ECUM_CFG_H_\r
-#define ECUM_CFG_H_\r
-\r
-#define ECUM_VERSION_INFO_API STD_OFF\r
-#define ECUM_INCLUDE_NVRAM_MGR STD_OFF\r
-#define ECUM_DEV_ERROR_DETECT STD_OFF\r
-\r
-#include "EcuM_Generated_Types.h"\r
-\r
-extern EcuM_ConfigType EcuMConfig;\r
-\r
-#endif /*ECUM_CFG_H_*/\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Generated_Types.h)\r
-* \r
-* Created by: \r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* \r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 14:42:38 CEST 2010\r
-*/\r
-\r
-\r
-#if (ECUM_SW_MAJOR_VERSION != 1) \r
-#error "EcuM: Configuration file version differs from BSW version."\r
-#endif\r
-\r
-\r
-#ifndef _ECUM_GENERATED_TYPES_H_\r
-#define _ECUM_GENERATED_TYPES_H_\r
-\r
-#if defined(USE_MCU)\r
-#include "Mcu.h"\r
-#endif\r
-#if defined(USE_PORT)\r
-#include "Port.h"\r
-#endif\r
-#if defined(USE_CAN)\r
-#include "Can.h"\r
-#endif\r
-#if defined(USE_CANIF)\r
-#include "CanIf.h"\r
-#endif\r
-#if defined(USE_PWM)\r
-#include "Pwm.h"\r
-#endif\r
-#if defined(USE_COM)\r
-#include "Com.h"\r
-#endif\r
-#if defined(USE_PDUR)\r
-#include "PduR.h"\r
-#endif\r
-#if defined(USE_DMA)\r
-#include "Dma.h"\r
-#endif\r
-#if defined(USE_ADC)\r
-#include "Adc.h"\r
-#endif\r
-#if defined(USE_GPT)\r
-#include "Gpt.h"\r
-#endif\r
-\r
-\r
-typedef struct\r
-{\r
- EcuM_StateType EcuMDefaultShutdownTarget;\r
- uint8 EcuMDefaultShutdownMode;\r
- AppModeType EcuMDefaultAppMode;\r
-\r
-#if defined(USE_MCU)\r
- const Mcu_ConfigType* McuConfig;\r
-#endif\r
-#if defined(USE_PORT)\r
- const Port_ConfigType* PortConfig;\r
-#endif\r
-#if defined(USE_CAN)\r
- const Can_ConfigType* CanConfig;\r
-#endif\r
-#if defined(USE_CANIF)\r
- const CanIf_ConfigType* CanIfConfig;\r
-#endif\r
-#if defined(USE_COM)\r
- const Com_ConfigType* ComConfig;\r
-#endif\r
-#if defined(USE_PDUR)\r
- const PduR_PBConfigType* PduRConfig;\r
-#endif\r
-#if defined(USE_PWM)\r
- const Pwm_ConfigType* PwmConfig;\r
-#endif\r
-#if defined(USE_DMA)\r
- const Dma_ConfigType* DmaConfig;\r
-#endif\r
-#if defined(USE_ADC)\r
- const Adc_ConfigType* AdcConfig;\r
-#endif\r
-#if defined(USE_GPT)\r
- const Gpt_ConfigType* GptConfig;\r
-#endif\r
-} EcuM_ConfigType;\r
-\r
-#endif /*_ECUM_GENERATED_TYPES_H_*/\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Callout_template.c)\r
-* \r
-* Created by: ArcCore AB\r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* Copyright ArcCore AB 2010\r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 15:43:38 CEST 2010\r
-*/\r
-\r
-\r
-#include "EcuM.h"\r
-#include "Det.h"\r
-#if defined(USE_DEM)\r
-#include "Dem.h"\r
-#endif\r
-#if defined(USE_MCU)\r
-#include "Mcu.h"\r
-#endif\r
-#if defined(USE_GPT)\r
-#include "Gpt.h"\r
-#endif\r
-#if defined(USE_CAN)\r
-#include "Can.h"\r
-#endif\r
-#if defined(USE_CANIF)\r
-#include "CanIf.h"\r
-#endif\r
-#if defined(USE_PDUR)\r
-#include "PduR.h"\r
-#endif\r
-#if defined(USE_COM)\r
-#include "Com.h"\r
-#endif\r
-#if defined(USE_CANTP)\r
-#include "CanTp.h"\r
-#endif\r
-#if defined(USE_DCM)\r
-#include "Dcm.h"\r
-#endif\r
-#if defined(USE_PWM)\r
-#include "Pwm.h"\r
-#endif\r
-#if defined(USE_IOHWAB)\r
-#include "IoHwAb.h"\r
-#endif\r
-\r
-void EcuM_AL_DriverInitZero()\r
-{\r
- Det_Init();\r
- Det_Start();\r
-}\r
-\r
-EcuM_ConfigType* EcuM_DeterminePbConfiguration()\r
-{\r
- return &EcuMConfig;\r
-}\r
-\r
-void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)\r
-{\r
-#if defined(USE_MCU)\r
- Mcu_Init(ConfigPtr->McuConfig);\r
-\r
- // Set up default clock (Mcu_InitClock requires initRun==1)\r
- Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings );\r
-\r
- // Wait for PLL to sync.\r
- while (Mcu_GetPllStatus() != MCU_PLL_LOCKED)\r
- ;\r
-#endif\r
-\r
-#if defined(USE_DEM)\r
- // Preinitialize DEM\r
- Dem_PreInit();\r
-#endif\r
-\r
-#if defined(USE_PORT)\r
- // Setup Port\r
- Port_Init(ConfigPtr->PortConfig);\r
-#endif\r
-\r
-\r
-#if defined(USE_GPT)\r
- // Setup the GPT\r
- Gpt_Init(ConfigPtr->GptConfig);\r
-#endif\r
-\r
- // Setup watchdog\r
- // TODO\r
-\r
-#if defined(USE_DMA)\r
- // Setup DMA\r
- Dma_Init(ConfigPtr->DmaConfig);\r
-#endif\r
-\r
-#if defined(USE_ADC)\r
- // Setup ADC\r
- Adc_Init(ConfigPtr->AdcConfig);\r
-#endif\r
-\r
- // Setup ICU\r
- // TODO\r
-\r
- // Setup PWM\r
-#if defined(USE_PWM)\r
- // Setup PWM\r
- Pwm_Init(ConfigPtr->PwmConfig);\r
-#endif\r
-}\r
-\r
-void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)\r
-{\r
-#if defined(USE_SPI)\r
- // Setup SPI\r
- Spi_Init(ConfigPtr->SpiConfig);\r
-#endif\r
-\r
-#if defined(USE_EEP)\r
- // Setup EEP\r
- Eep_Init(ConfigPtr->EEpConfig);\r
-#endif\r
-\r
-#if defined(USE_FLS)\r
- // Setup Flash\r
- FlashInit(ConfigPtr->FlashConfig);\r
-#endif\r
-\r
- // Setup NVRAM Manaager\r
- // TODO\r
-\r
- // Setup CAN tranceiver\r
- // TODO\r
-\r
-#if defined(USE_CAN)\r
- // Setup Can driver\r
- Can_Init(ConfigPtr->CanConfig);\r
-#endif\r
-\r
-#if defined(USE_CANIF)\r
- // Setup CanIf\r
- CanIf_Init(ConfigPtr->CanIfConfig);\r
-#endif\r
-\r
-#if defined(USE_CANTP)\r
- // Setup CAN TP\r
- CanTp_Init();\r
-#endif\r
- // Setup LIN\r
- // TODO\r
-\r
-#if defined(USE_PDUR)\r
- // Setup PDU Router\r
- PduR_Init(ConfigPtr->PduRConfig);\r
-#endif\r
-\r
-#if defined(USE_COM)\r
- // Setup COM layer\r
- Com_Init(ConfigPtr->ComConfig);\r
-#endif\r
-\r
-#if defined(USE_DCM)\r
- // Setup DCM\r
- Dcm_Init();\r
-#endif\r
-\r
-#if defined(USE_IOHWAB)\r
- // Setup IO hardware abstraction layer\r
- IoHwAb_Init();\r
-#endif\r
-\r
-}\r
-\r
-void EcuM_AL_DriverInitThree(const EcuM_ConfigType ConfigPtr)\r
-{\r
-#if defined(USE_DEM)\r
- // Setup DEM\r
- Dem_Init();\r
-#endif\r
-\r
-#if defined(USE_CANIF)\r
- // Startup the CAN interafce; due to the missing COM manager\r
- CanIf_InitController(CANIF_CHANNEL_0, CANIF_CHANNEL_0_CONFIG_0);\r
- CanIf_SetControllerMode(CANIF_CHANNEL_0, CANIF_CS_STARTED);\r
-#endif\r
-}\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Cfg.c)\r
-* \r
-* Created by: ArcCore AB\r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* Copyright ArcCore AB 2010\r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 15:43:38 CEST 2010\r
-*/\r
-\r
-\r
-\r
-#include "EcuM.h"\r
-\r
-EcuM_ConfigType EcuMConfig =\r
-{\r
- .EcuMDefaultShutdownTarget = ECUM_STATE_RESET,\r
- .EcuMDefaultShutdownMode = 0, // Don't care\r
- .EcuMDefaultAppMode = 0, // Don't care\r
-\r
-#if defined(USE_MCU)\r
- .McuConfig = McuConfigData,\r
-#endif\r
-#if defined(USE_PORT)\r
- .PortConfig = &PortConfigData,\r
-#endif\r
-#if defined(USE_CAN)\r
- .CanConfig = &CanConfigData,\r
-#endif\r
-#if defined(USE_CANIF)\r
- .CanIfConfig = &CanIf_Config,\r
-#endif\r
-#if defined(USE_COM)\r
- .ComConfig = &ComConfiguration,\r
-#endif\r
-#if defined(USE_PDUR)\r
- .PduRConfig = &PduR_Config,\r
-#endif\r
-#if defined(USE_DMA)\r
- .DmaConfig = DmaConfig,\r
-#endif\r
-#if defined(USE_ADC)\r
- .AdcConfig = AdcConfig,\r
-#endif\r
-#if defined(USE_PWM)\r
- .PwmConfig = &PwmConfig,\r
-#endif\r
-#if defined(USE_GPT)\r
- .GptConfig = GptConfigData,\r
-#endif\r
-};\r
-\r
-void EcuM_OnGoOffTwo( void ) {\r
-\r
-}\r
-\r
-void EcuM_AL_SwitchOff( void ) {\r
-\r
-}\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Cfg.h)\r
-* \r
-* Created by: ArcCore AB\r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* Copyright ArcCore AB 2010\r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 15:54:06 CEST 2010\r
-*/\r
-\r
-\r
-#if (ECUM_SW_MAJOR_VERSION != 1) \r
-#error "EcuM: Configuration file version differs from BSW version."\r
-#endif\r
-\r
-\r
-\r
-#ifndef ECUM_CFG_H_\r
-#define ECUM_CFG_H_\r
-\r
-#define ECUM_VERSION_INFO_API STD_OFF\r
-#define ECUM_INCLUDE_NVRAM_MGR STD_OFF\r
-#define ECUM_DEV_ERROR_DETECT STD_OFF\r
-\r
-#include "EcuM_Generated_Types.h"\r
-\r
-extern EcuM_ConfigType EcuMConfig;\r
-\r
-#endif /*ECUM_CFG_H_*/\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Generated_Types.h)\r
-* \r
-* Created by: ArcCore AB\r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* Copyright ArcCore AB 2010\r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 15:43:38 CEST 2010\r
-*/\r
-\r
-\r
-#if (ECUM_SW_MAJOR_VERSION != 1) \r
-#error "EcuM: Configuration file version differs from BSW version."\r
-#endif\r
-\r
-\r
-#ifndef _ECUM_GENERATED_TYPES_H_\r
-#define _ECUM_GENERATED_TYPES_H_\r
-\r
-#if defined(USE_MCU)\r
-#include "Mcu.h"\r
-#endif\r
-#if defined(USE_PORT)\r
-#include "Port.h"\r
-#endif\r
-#if defined(USE_CAN)\r
-#include "Can.h"\r
-#endif\r
-#if defined(USE_CANIF)\r
-#include "CanIf.h"\r
-#endif\r
-#if defined(USE_PWM)\r
-#include "Pwm.h"\r
-#endif\r
-#if defined(USE_COM)\r
-#include "Com.h"\r
-#endif\r
-#if defined(USE_PDUR)\r
-#include "PduR.h"\r
-#endif\r
-#if defined(USE_DMA)\r
-#include "Dma.h"\r
-#endif\r
-#if defined(USE_ADC)\r
-#include "Adc.h"\r
-#endif\r
-#if defined(USE_GPT)\r
-#include "Gpt.h"\r
-#endif\r
-\r
-\r
-typedef struct\r
-{\r
- EcuM_StateType EcuMDefaultShutdownTarget;\r
- uint8 EcuMDefaultShutdownMode;\r
- AppModeType EcuMDefaultAppMode;\r
-\r
-#if defined(USE_MCU)\r
- const Mcu_ConfigType* McuConfig;\r
-#endif\r
-#if defined(USE_PORT)\r
- const Port_ConfigType* PortConfig;\r
-#endif\r
-#if defined(USE_CAN)\r
- const Can_ConfigType* CanConfig;\r
-#endif\r
-#if defined(USE_CANIF)\r
- const CanIf_ConfigType* CanIfConfig;\r
-#endif\r
-#if defined(USE_COM)\r
- const Com_ConfigType* ComConfig;\r
-#endif\r
-#if defined(USE_PDUR)\r
- const PduR_PBConfigType* PduRConfig;\r
-#endif\r
-#if defined(USE_PWM)\r
- const Pwm_ConfigType* PwmConfig;\r
-#endif\r
-#if defined(USE_DMA)\r
- const Dma_ConfigType* DmaConfig;\r
-#endif\r
-#if defined(USE_ADC)\r
- const Adc_ConfigType* AdcConfig;\r
-#endif\r
-#if defined(USE_GPT)\r
- const Gpt_ConfigType* GptConfig;\r
-#endif\r
-} EcuM_ConfigType;\r
-\r
-#endif /*_ECUM_GENERATED_TYPES_H_*/\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Callout_template.c)\r
-* \r
-* Created by: ArcCore AB\r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* Copyright ArcCore AB 2010\r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 15:43:38 CEST 2010\r
-*/\r
-\r
-\r
-#include "EcuM.h"\r
-#include "Det.h"\r
-#if defined(USE_DEM)\r
-#include "Dem.h"\r
-#endif\r
-#if defined(USE_MCU)\r
-#include "Mcu.h"\r
-#endif\r
-#if defined(USE_GPT)\r
-#include "Gpt.h"\r
-#endif\r
-#if defined(USE_CAN)\r
-#include "Can.h"\r
-#endif\r
-#if defined(USE_CANIF)\r
-#include "CanIf.h"\r
-#endif\r
-#if defined(USE_PDUR)\r
-#include "PduR.h"\r
-#endif\r
-#if defined(USE_COM)\r
-#include "Com.h"\r
-#endif\r
-#if defined(USE_CANTP)\r
-#include "CanTp.h"\r
-#endif\r
-#if defined(USE_DCM)\r
-#include "Dcm.h"\r
-#endif\r
-#if defined(USE_PWM)\r
-#include "Pwm.h"\r
-#endif\r
-#if defined(USE_IOHWAB)\r
-#include "IoHwAb.h"\r
-#endif\r
-\r
-void EcuM_AL_DriverInitZero()\r
-{\r
- Det_Init();\r
- Det_Start();\r
-}\r
-\r
-EcuM_ConfigType* EcuM_DeterminePbConfiguration()\r
-{\r
- return &EcuMConfig;\r
-}\r
-\r
-void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)\r
-{\r
-#if defined(USE_MCU)\r
- Mcu_Init(ConfigPtr->McuConfig);\r
-\r
- // Set up default clock (Mcu_InitClock requires initRun==1)\r
- Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings );\r
-\r
- // Wait for PLL to sync.\r
- while (Mcu_GetPllStatus() != MCU_PLL_LOCKED)\r
- ;\r
-#endif\r
-\r
-#if defined(USE_DEM)\r
- // Preinitialize DEM\r
- Dem_PreInit();\r
-#endif\r
-\r
-#if defined(USE_PORT)\r
- // Setup Port\r
- Port_Init(ConfigPtr->PortConfig);\r
-#endif\r
-\r
-\r
-#if defined(USE_GPT)\r
- // Setup the GPT\r
- Gpt_Init(ConfigPtr->GptConfig);\r
-#endif\r
-\r
- // Setup watchdog\r
- // TODO\r
-\r
-#if defined(USE_DMA)\r
- // Setup DMA\r
- Dma_Init(ConfigPtr->DmaConfig);\r
-#endif\r
-\r
-#if defined(USE_ADC)\r
- // Setup ADC\r
- Adc_Init(ConfigPtr->AdcConfig);\r
-#endif\r
-\r
- // Setup ICU\r
- // TODO\r
-\r
- // Setup PWM\r
-#if defined(USE_PWM)\r
- // Setup PWM\r
- Pwm_Init(ConfigPtr->PwmConfig);\r
-#endif\r
-}\r
-\r
-void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr)\r
-{\r
-#if defined(USE_SPI)\r
- // Setup SPI\r
- Spi_Init(ConfigPtr->SpiConfig);\r
-#endif\r
-\r
-#if defined(USE_EEP)\r
- // Setup EEP\r
- Eep_Init(ConfigPtr->EEpConfig);\r
-#endif\r
-\r
-#if defined(USE_FLS)\r
- // Setup Flash\r
- FlashInit(ConfigPtr->FlashConfig);\r
-#endif\r
-\r
- // Setup NVRAM Manaager\r
- // TODO\r
-\r
- // Setup CAN tranceiver\r
- // TODO\r
-\r
-#if defined(USE_CAN)\r
- // Setup Can driver\r
- Can_Init(ConfigPtr->CanConfig);\r
-#endif\r
-\r
-#if defined(USE_CANIF)\r
- // Setup CanIf\r
- CanIf_Init(ConfigPtr->CanIfConfig);\r
-#endif\r
-\r
-#if defined(USE_CANTP)\r
- // Setup CAN TP\r
- CanTp_Init();\r
-#endif\r
- // Setup LIN\r
- // TODO\r
-\r
-#if defined(USE_PDUR)\r
- // Setup PDU Router\r
- PduR_Init(ConfigPtr->PduRConfig);\r
-#endif\r
-\r
-#if defined(USE_COM)\r
- // Setup COM layer\r
- Com_Init(ConfigPtr->ComConfig);\r
-#endif\r
-\r
-#if defined(USE_DCM)\r
- // Setup DCM\r
- Dcm_Init();\r
-#endif\r
-\r
-#if defined(USE_IOHWAB)\r
- // Setup IO hardware abstraction layer\r
- IoHwAb_Init();\r
-#endif\r
-\r
-}\r
-\r
-void EcuM_AL_DriverInitThree(const EcuM_ConfigType ConfigPtr)\r
-{\r
-#if defined(USE_DEM)\r
- // Setup DEM\r
- Dem_Init();\r
-#endif\r
-\r
-#if defined(USE_CANIF)\r
- // Startup the CAN interafce; due to the missing COM manager\r
- CanIf_InitController(CANIF_CHANNEL_0, CANIF_CHANNEL_0_CONFIG_0);\r
- CanIf_SetControllerMode(CANIF_CHANNEL_0, CANIF_CS_STARTED);\r
-#endif\r
-}\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Cfg.c)\r
-* \r
-* Created by: ArcCore AB\r
-* Configured for (MCU): MPC551x\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* Copyright ArcCore AB 2010\r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 15:43:38 CEST 2010\r
-*/\r
-\r
-\r
-\r
-#include "EcuM.h"\r
-\r
-EcuM_ConfigType EcuMConfig =\r
-{\r
- .EcuMDefaultShutdownTarget = ECUM_STATE_RESET,\r
- .EcuMDefaultShutdownMode = 0, // Don't care\r
- .EcuMDefaultAppMode = 0, // Don't care\r
-\r
-#if defined(USE_MCU)\r
- .McuConfig = McuConfigData,\r
-#endif\r
-#if defined(USE_PORT)\r
- .PortConfig = &PortConfigData,\r
-#endif\r
-#if defined(USE_CAN)\r
- .CanConfig = &CanConfigData,\r
-#endif\r
-#if defined(USE_CANIF)\r
- .CanIfConfig = &CanIf_Config,\r
-#endif\r
-#if defined(USE_COM)\r
- .ComConfig = &ComConfiguration,\r
-#endif\r
-#if defined(USE_PDUR)\r
- .PduRConfig = &PduR_Config,\r
-#endif\r
-#if defined(USE_DMA)\r
- .DmaConfig = DmaConfig,\r
-#endif\r
-#if defined(USE_ADC)\r
- .AdcConfig = AdcConfig,\r
-#endif\r
-#if defined(USE_PWM)\r
- .PwmConfig = &PwmConfig,\r
-#endif\r
-#if defined(USE_GPT)\r
- .GptConfig = GptConfigData,\r
-#endif\r
-};\r
-\r
-void EcuM_OnGoOffTwo( void ) {\r
-\r
-}\r
-\r
-void EcuM_AL_SwitchOff( void ) {\r
-\r
-}\r
+++ /dev/null
-/*
-* Configuration of module EcuM (EcuM_Cfg.h)
-*
-* Created by:
-* Configured for (MCU): MPC5567
-*
-* Module vendor: ArcCore
-* Module version: 2.0.0
-*
-*
-* Generated by Arctic Studio (http://arccore.com)
-* on Thu Jun 17 15:44:16 CEST 2010
-*/
-
-
-#if (ECUM_SW_MAJOR_VERSION != 1)
-#error "EcuM: Configuration file version differs from BSW version."
-#endif
-
-\r
-\r
-#ifndef ECUM_CFG_H_\r
-#define ECUM_CFG_H_\r
-\r
-#define ECUM_VERSION_INFO_API STD_OFF\r
-#define ECUM_INCLUDE_NVRAM_MGR STD_OFF\r
-#define ECUM_DEV_ERROR_DETECT STD_OFF\r
-\r
-#include "EcuM_Generated_Types.h"\r
-\r
-extern EcuM_ConfigType EcuMConfig;\r
-\r
-#endif /*ECUM_CFG_H_*/\r
+++ /dev/null
-/* \r
-* Configuration of module EcuM (EcuM_Generated_Types.h)\r
-* \r
-* Created by: ArcCore AB\r
-* Configured for (MCU): MPC5567\r
-* \r
-* Module editor vendor: ArcCore\r
-* Module editor version: 2.0.0\r
-* \r
-* Copyright ArcCore AB 2010\r
-* Generated by Arctic Studio (http://arccore.com)\r
-* on Fri Apr 30 15:43:38 CEST 2010\r
-*/\r
-\r
-\r
-#if (ECUM_SW_MAJOR_VERSION != 1) \r
-#error "EcuM: Configuration file version differs from BSW version."\r
-#endif\r
-\r
-\r
-#ifndef _ECUM_GENERATED_TYPES_H_\r
-#define _ECUM_GENERATED_TYPES_H_\r
-\r
-#if defined(USE_MCU)\r
-#include "Mcu.h"\r
-#endif\r
-#if defined(USE_PORT)\r
-#include "Port.h"\r
-#endif\r
-#if defined(USE_CAN)\r
-#include "Can.h"\r
-#endif\r
-#if defined(USE_CANIF)\r
-#include "CanIf.h"\r
-#endif\r
-#if defined(USE_PWM)\r
-#include "Pwm.h"\r
-#endif\r
-#if defined(USE_COM)\r
-#include "Com.h"\r
-#endif\r
-#if defined(USE_PDUR)\r
-#include "PduR.h"\r
-#endif\r
-#if defined(USE_DMA)\r
-#include "Dma.h"\r
-#endif\r
-#if defined(USE_ADC)\r
-#include "Adc.h"\r
-#endif\r
-#if defined(USE_GPT)\r
-#include "Gpt.h"\r
-#endif\r
-\r
-\r
-typedef struct\r
-{\r
- EcuM_StateType EcuMDefaultShutdownTarget;\r
- uint8 EcuMDefaultShutdownMode;\r
- AppModeType EcuMDefaultAppMode;\r
-\r
-#if defined(USE_MCU)\r
- const Mcu_ConfigType* McuConfig;\r
-#endif\r
-#if defined(USE_PORT)\r
- const Port_ConfigType* PortConfig;\r
-#endif\r
-#if defined(USE_CAN)\r
- const Can_ConfigType* CanConfig;\r
-#endif\r
-#if defined(USE_CANIF)\r
- const CanIf_ConfigType* CanIfConfig;\r
-#endif\r
-#if defined(USE_COM)\r
- const Com_ConfigType* ComConfig;\r
-#endif\r
-#if defined(USE_PDUR)\r
- const PduR_PBConfigType* PduRConfig;\r
-#endif\r
-#if defined(USE_PWM)\r
- const Pwm_ConfigType* PwmConfig;\r
-#endif\r
-#if defined(USE_DMA)\r
- const Dma_ConfigType* DmaConfig;\r
-#endif\r
-#if defined(USE_ADC)\r
- const Adc_ConfigType* AdcConfig;\r
-#endif\r
-#if defined(USE_GPT)\r
- const Gpt_ConfigType* GptConfig;\r
-#endif\r
-} EcuM_ConfigType;\r
-\r
-#endif /*_ECUM_GENERATED_TYPES_H_*/\r
#include "Mcu.h"\r
#include "Det.h"\r
#include "irq.h"\r
-#if (ECUM_INCLUDE_NVRAM_MGR == STD_ON)\r
+#if defined(USE_NVM)\r
#include "Nvm.h"\r
#endif\r
\r
\r
void EcuM_StartupTwo()\r
{\r
-#if (ECUM_INCLUDE_NVRAM_MGR == STD_ON)\r
+#if defined(USE_NVM)\r
extern CounterType Os_Arc_OsTickCounter;\r
TickType tickTimerStart, tickTimer, tickTimerElapsed;\r
StatusType tickTimerStatus;\r
// Initialize drivers that don't need NVRAM data\r
EcuM_AL_DriverInitTwo(internal_data.config);\r
\r
-#if (ECUM_INCLUDE_NVRAM_MGR == STD_ON)\r
+#if defined(USE_NVM)\r
// Start timer to wait for NVM job to complete\r
tickTimerStatus = GetCounterValue(Os_Arc_OsTickCounter , &tickTimerStart);\r
if (tickTimerStatus != E_OK) {\r
Rte_Start();\r
#endif\r
\r
-#if (ECUM_INCLUDE_NVRAM_MGR == STD_ON)\r
+#if defined(USE_NVM)\r
// Wait for the NVM job (NvmReadAll) to terminate\r
do {\r
NvM_GetErrorStatus(0, &readAllResult); // Read the multiblock status\r
#if defined(USE_DEM)\r
#include "Dem.h"\r
#endif\r
-#if (ECUM_INCLUDE_NVRAM_MGR == STD_ON)\r
+#if defined(USE_NVM)\r
#include "Nvm.h"\r
#endif\r
\r
static uint32 internal_data_run_state_timeout = 0;\r
-#if (ECUM_INCLUDE_NVRAM_MGR == STD_ON)\r
+#if defined(USE_NVM)\r
static uint32 internal_data_go_off_one_state_timeout = 0;\r
#endif\r
\r
{\r
internal_data.current_state = ECUM_STATE_APP_RUN;\r
EcuM_OnEnterRUN();\r
- internal_data_run_state_timeout = internal_data.config->EcuMRunSelfRequestPeriod / ECUM_MAIN_FUNCTION_PERIOD;\r
+ internal_data_run_state_timeout = internal_data.config->EcuMRunMinimumDuration / ECUM_MAIN_FUNCTION_PERIOD;\r
}\r
\r
static inline void enter_post_run_mode(void)\r
ComM_DeInit();\r
#endif\r
\r
-#if (ECUM_INCLUDE_NVRAM_MGR == STD_ON)\r
+#if defined(USE_NVM)\r
\r
// Start NvM_WriteAll and timeout timer\r
NvM_WriteAll();\r
\r
void EcuM_MainFunction(void)\r
{\r
-#if (ECUM_INCLUDE_NVRAM_MGR == STD_ON)\r
+#if defined(USE_NVM)\r
static NvM_RequestResultType writeAllResult;\r
#endif\r
\r
\r
if (internal_data.current_state == ECUM_STATE_GO_OFF_ONE)\r
{\r
-#if (ECUM_INCLUDE_NVRAM_MGR == STD_ON)\r
+#if defined(USE_NVM)\r
if (internal_data_go_off_one_state_timeout)\r
internal_data_go_off_one_state_timeout--;\r
\r