From 10c4b2d14ce592ac93bfa9ac66d4625175558a7f Mon Sep 17 00:00:00 2001 From: joek Date: Tue, 30 Nov 2010 15:37:57 +0100 Subject: [PATCH] Added NM modules to default config EcuM --- boards/generic/EcuM_Callout_template.c | 66 +++++++--- boards/generic/EcuM_Cfg.c | 100 +++++++------- boards/generic/EcuM_Generated_Types.h | 176 ++++++++++++++----------- 3 files changed, 203 insertions(+), 139 deletions(-) diff --git a/boards/generic/EcuM_Callout_template.c b/boards/generic/EcuM_Callout_template.c index 86e4070b..8ecccc1a 100644 --- a/boards/generic/EcuM_Callout_template.c +++ b/boards/generic/EcuM_Callout_template.c @@ -1,17 +1,17 @@ -/* -* Configuration of module EcuM (EcuM_Callout_template.c) -* -* Created by: -* 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 -*/ - +/* -------------------------------- Arctic Core ------------------------------ + * Arctic Core - the open source AUTOSAR platform http://arccore.com + * + * Copyright (C) 2009 ArcCore AB + * + * This source code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation; See . + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * -------------------------------- Arctic Core ------------------------------*/ #warning "This default file may only be used as an example!" @@ -65,6 +65,21 @@ #if defined(USE_NVM) #include "NvM.h" #endif +#if defined(USE_COMM) +#include "ComM.h" +#endif +#if defined(USE_NM) +#include "Nm.h" +#endif +#if defined(USE_CANNM) +#include "CanNm.h" +#endif +#if defined(USE_CANSM) +#include "CanSM.h" +#endif +#if defined(USE_LINSM) +#include "LinSM.h" +#endif void EcuM_AL_DriverInitZero() { @@ -179,6 +194,10 @@ void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr) // Setup CAN TP CanTp_Init(); #endif + +#if defined(USE_CANSM) + CanSM_Init(ConfigPtr->CanSMConfig); +#endif // Setup LIN // TODO @@ -187,6 +206,16 @@ void EcuM_AL_DriverInitTwo(const EcuM_ConfigType* ConfigPtr) // Setup PDU Router PduR_Init(ConfigPtr->PduRConfig); #endif + +#if defined(USE_CANNM) + // Setup Can Network Manager + CanNm_Init(ConfigPtr->CanNmConfig); +#endif + +#if defined(USE_NM) + // Setup Network Management Interface + Nm_Init(ConfigPtr->NmConfig); +#endif #if defined(USE_COM) // Setup COM layer @@ -212,11 +241,10 @@ void EcuM_AL_DriverInitThree(const EcuM_ConfigType ConfigPtr) Dem_Init(); #endif -#if defined(USE_CANIF) - // Startup the CAN interafce; due to the missing COM manager - //CanIf_InitController(CAN_CTRL_A, 0); - //CanIf_SetControllerMode(CAN_CTRL_A, CANIF_CS_STARTED); -#endif +#if defined(USE_COMM) + // Setup Communication Manager + ComM_Init(ConfigPtr->ComMConfig); +#endif } void EcuM_OnEnterRUN(void) diff --git a/boards/generic/EcuM_Cfg.c b/boards/generic/EcuM_Cfg.c index a9a7f1a5..1d8215e0 100644 --- a/boards/generic/EcuM_Cfg.c +++ b/boards/generic/EcuM_Cfg.c @@ -1,16 +1,17 @@ -/* -* Configuration of module EcuM (EcuM_Cfg.c) -* -* Created by: -* 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 -*/ +/* -------------------------------- Arctic Core ------------------------------ + * Arctic Core - the open source AUTOSAR platform http://arccore.com + * + * Copyright (C) 2009 ArcCore AB + * + * This source code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation; See . + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * -------------------------------- Arctic Core ------------------------------*/ #warning "This default file may only be used as an example!" @@ -25,38 +26,49 @@ EcuM_ConfigType EcuMConfig = .EcuMNvramWriteAllTimeout = ECUM_NVRAM_WRITEALL_TIMEOUT, .EcuMRunMinimumDuration = ECUM_NVRAM_MIN_RUN_DURATION, -#if defined(USE_MCU) - .McuConfig = McuConfigData, -#endif -#if defined(USE_PORT) - .PortConfig = &PortConfigData, -#endif -#if defined(USE_CAN) - .CanConfig = &CanConfigData, -#endif -#if defined(USE_CANIF) - .CanIfConfig = &CanIf_Config, -#endif -#if defined(USE_COM) - .ComConfig = &ComConfiguration, -#endif -#if defined(USE_PDUR) - .PduRConfig = &PduR_Config, -#endif -#if defined(USE_DMA) - .DmaConfig = DmaConfig, -#endif -#if defined(USE_ADC) - .AdcConfig = AdcConfig, -#endif -#if defined(USE_PWM) - .PwmConfig = &PwmConfig, -#endif -#if defined(USE_GPT) - .GptConfig = GptConfigData, -#endif +#if defined(USE_MCU) + .McuConfig = McuConfigData, +#endif +#if defined(USE_PORT) + .PortConfig = &PortConfigData, +#endif +#if defined(USE_CAN) + .CanConfig = &CanConfigData, +#endif +#if defined(USE_CANIF) + .CanIfConfig = &CanIf_Config, +#endif +#if defined(USE_CANSM) + .CanSMConfig = &CanSM_Config, +#endif +#if defined(USE_CANNM) + .CanNmConfig = &CanNm_Config, +#endif +#if defined(USE_COM) + .ComConfig = &ComConfiguration, +#endif +#if defined(USE_COMM) + .ComMConfig = &ComM_Config, +#endif +#if defined(USE_NM) + .NmConfig = &Nm_Config, +#endif +#if defined(USE_PDUR) + .PduRConfig = &PduR_Config, +#endif +#if defined(USE_DMA) + .DmaConfig = DmaConfig, +#endif +#if defined(USE_ADC) + .AdcConfig = AdcConfig, +#endif +#if defined(USE_PWM) + .PwmConfig = &PwmConfig, +#endif +#if defined(USE_GPT) + .GptConfig = GptConfigData, +#endif #if defined(USE_FLS) .FlashConfig = FlsConfigSet, #endif - }; diff --git a/boards/generic/EcuM_Generated_Types.h b/boards/generic/EcuM_Generated_Types.h index 030c2d72..0ca50dab 100644 --- a/boards/generic/EcuM_Generated_Types.h +++ b/boards/generic/EcuM_Generated_Types.h @@ -1,16 +1,17 @@ -/* -* Configuration of module EcuM (EcuM_Generated_Types.h) -* -* Created by: -* 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 -*/ +/* -------------------------------- Arctic Core ------------------------------ + * Arctic Core - the open source AUTOSAR platform http://arccore.com + * + * Copyright (C) 2009 ArcCore AB + * + * This source code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by the + * Free Software Foundation; See . + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * -------------------------------- Arctic Core ------------------------------*/ #warning "This default file may only be used as an example!" @@ -23,40 +24,51 @@ #ifndef _ECUM_GENERATED_TYPES_H_ #define _ECUM_GENERATED_TYPES_H_ -#if defined(USE_MCU) -#include "Mcu.h" -#endif -#if defined(USE_PORT) -#include "Port.h" -#endif -#if defined(USE_CAN) -#include "Can.h" -#endif -#if defined(USE_CANIF) -#include "CanIf.h" -#endif -#if defined(USE_PWM) -#include "Pwm.h" -#endif -#if defined(USE_COM) -#include "Com.h" -#endif -#if defined(USE_PDUR) -#include "PduR.h" -#endif -#if defined(USE_DMA) -#include "Dma.h" -#endif -#if defined(USE_ADC) -#include "Adc.h" -#endif -#if defined(USE_GPT) -#include "Gpt.h" -#endif -#if defined(USE_FLS) -#include "Fls.h" +#if defined(USE_MCU) +#include "Mcu.h" #endif - +#if defined(USE_PORT) +#include "Port.h" +#endif +#if defined(USE_CAN) +#include "Can.h" +#endif +#if defined(USE_CANIF) +#include "CanIf.h" +#endif +#if defined(USE_PWM) +#include "Pwm.h" +#endif +#if defined(USE_COM) +#include "Com.h" +#endif +#if defined(USE_PDUR) +#include "PduR.h" +#endif +#if defined(USE_DMA) +#include "Dma.h" +#endif +#if defined(USE_ADC) +#include "Adc.h" +#endif +#if defined(USE_GPT) +#include "Gpt.h" +#endif +#if defined(USE_COMM) +#include "ComM.h" +#endif +#if defined(USE_NM) +#include "Nm.h" +#endif +#if defined(USE_CANNM) +#include "CanNm.h" +#endif +#if defined(USE_CANSM) +#include "CanSM.h" +#endif +#if defined(USE_LINSM) +#include "LinSM.h" +#endif typedef struct { @@ -67,36 +79,48 @@ typedef struct uint32 EcuMNvramReadAllTimeout; uint32 EcuMNvramWriteAllTimeout; -#if defined(USE_MCU) - const Mcu_ConfigType* McuConfig; -#endif -#if defined(USE_PORT) - const Port_ConfigType* PortConfig; -#endif -#if defined(USE_CAN) - const Can_ConfigType* CanConfig; -#endif -#if defined(USE_CANIF) - const CanIf_ConfigType* CanIfConfig; -#endif -#if defined(USE_COM) - const Com_ConfigType* ComConfig; -#endif -#if defined(USE_PDUR) - const PduR_PBConfigType* PduRConfig; -#endif -#if defined(USE_PWM) - const Pwm_ConfigType* PwmConfig; -#endif -#if defined(USE_DMA) - const Dma_ConfigType* DmaConfig; -#endif -#if defined(USE_ADC) - const Adc_ConfigType* AdcConfig; -#endif -#if defined(USE_GPT) - const Gpt_ConfigType* GptConfig; -#endif +#if defined(USE_MCU) + const Mcu_ConfigType* McuConfig; +#endif +#if defined(USE_PORT) + const Port_ConfigType* PortConfig; +#endif +#if defined(USE_CAN) + const Can_ConfigType* CanConfig; +#endif +#if defined(USE_CANIF) + const CanIf_ConfigType* CanIfConfig; +#endif +#if defined(USE_CANSM) + const CanSM_ConfigType* CanSMConfig; +#endif +#if defined(USE_NM) + const Nm_ConfigType* NmConfig; +#endif +#if defined(USE_CANNM) + const CanNm_ConfigType* CanNmConfig; +#endif +#if defined(USE_COMM) + const ComM_ConfigType* ComMConfig; +#endif +#if defined(USE_COM) + const Com_ConfigType* ComConfig; +#endif +#if defined(USE_PDUR) + const PduR_PBConfigType* PduRConfig; +#endif +#if defined(USE_PWM) + const Pwm_ConfigType* PwmConfig; +#endif +#if defined(USE_DMA) + const Dma_ConfigType* DmaConfig; +#endif +#if defined(USE_ADC) + const Adc_ConfigType* AdcConfig; +#endif +#if defined(USE_GPT) + const Gpt_ConfigType* GptConfig; +#endif #if defined(USE_FLS) const Fls_ConfigType* FlashConfig; #endif -- 2.39.2