]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Minor corrections to EcuM/GPT
authormahi <devnull@localhost>
Thu, 13 Sep 2012 07:22:24 +0000 (09:22 +0200)
committermahi <devnull@localhost>
Thu, 13 Sep 2012 07:22:24 +0000 (09:22 +0200)
boards/generic/EcuM_Generated_Types.h [deleted file]
include/Gpt.h
system/EcuM/EcuM_Callout_Stubs.c [new file with mode: 0644]

diff --git a/boards/generic/EcuM_Generated_Types.h b/boards/generic/EcuM_Generated_Types.h
deleted file mode 100644 (file)
index b9e0417..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -------------------------------- Arctic Core ------------------------------
- * Arctic Core - the open source AUTOSAR platform http://arccore.com
- *
- * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
- *
- * 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 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
- *
- * 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!"
-
-#if ((ECUM_SW_MAJOR_VERSION != 2) && (ECUM_SW_MINOR_VERSION != 0))
-#error "EcuM: Configuration file version differs from BSW version."
-#endif
-
-\r
-#ifndef _ECUM_GENERATED_TYPES_H_\r
-#define _ECUM_GENERATED_TYPES_H_\r
-\r
-#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"
-#endif
-#if defined(USE_EEP)
-#include "Eep.h"
-#endif
-#if defined(USE_WDG)
-#include "Wdg.h"
-#endif
-#if defined(USE_WDGM)
-#include "WdgM.h"
-#endif
-#if defined(USE_WDGIF)
-#include "WdgIf.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\r
-\r
-typedef struct EcuM_Config\r
-{\r
-       EcuM_StateType EcuMDefaultShutdownTarget;\r
-       uint8 EcuMDefaultSleepMode;\r
-       AppModeType EcuMDefaultAppMode;\r
-       uint32 EcuMRunMinimumDuration;
-       uint32 EcuMNvramReadAllTimeout;
-       uint32 EcuMNvramWriteAllTimeout;
-\r
-#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_WDG)
-    const Wdg_ConfigType* WdgConfig;
-#endif
-#if defined(USE_WDGIF)
-    const WdgIf_ConfigType* WdgIfConfig;
-#endif
-#if defined(USE_WDGM)
-    const WdgM_ConfigType* WdgMConfig;
-#endif
-#if defined(USE_GPT)
-    const Gpt_ConfigType* GptConfig;
-#endif
-#if defined(USE_FLS)
-       const Fls_ConfigType* FlashConfig;
-#endif
-#if defined(USE_EEP)
-       const Eep_ConfigType* EepConfig;
-#endif
-#if defined(USE_SPI)
-       const Spi_ConfigType* SpiConfig;
-#endif
-} EcuM_ConfigType;\r
-\r
-#endif /*_ECUM_GENERATED_TYPES_H_*/\r
index f0ce66db0b4d9fb2c7dfae2d0ea8cc48d3ac2fe1..703d1d1c4f7b21351a824490a6ea95d2f2889c9f 100644 (file)
@@ -97,9 +97,9 @@ typedef uint8_t Gpt_ChannelType;
 #define GPT_AR_MINOR_VERSION     2\r
 #define GPT_AR_PATCH_VERSION     1\r
 \r
-//#if (GPT_REPORT_WAKEUP_SOURCE==STD_ON)\r
+#if (GPT_REPORT_WAKEUP_SOURCE==STD_ON)\r
 #include "EcuM_Cbk.h"          /* @req 4.0.3/GPT271 */\r
-//#endif\r
+#endif\r
 \r
 /* Needs Gpt_ConfigType */\r
 #include "Gpt_Cfg.h"           /* @req 4.0.3/GPT259 */\r
diff --git a/system/EcuM/EcuM_Callout_Stubs.c b/system/EcuM/EcuM_Callout_Stubs.c
new file mode 100644 (file)
index 0000000..3068032
--- /dev/null
@@ -0,0 +1,408 @@
+/*\r
+* Configuration of module: EcuM (EcuM_Callout_Stubs.c)\r
+*\r
+* Created by:              \r
+* Copyright:               \r
+*\r
+* Configured for (MCU):    MPC5567\r
+*\r
+* Module vendor:           ArcCore\r
+* Generator version:       2.0.2\r
+*\r
+* Generated by Arctic Studio (http://arccore.com) \r
+*/\r
+\r
+\r
+#include "EcuM.h"\r
+#include "EcuM_Generated_Types.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_J1939TP)\r
+#include "J1939Tp.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
+#if defined(USE_FLS)\r
+#include "Fls.h"\r
+#endif\r
+#if defined(USE_EEP)\r
+#include "Eep.h"\r
+#endif\r
+#if defined(USE_FEE)\r
+#include "Fee.h"\r
+#endif\r
+#if defined(USE_EA)\r
+#include "Ea.h"\r
+#endif\r
+#if defined(USE_NVM)\r
+#include "NvM.h"\r
+#endif\r
+#if defined(USE_COMM)\r
+#include "ComM.h"\r
+#endif\r
+#if defined(USE_NM)\r
+#include "Nm.h"\r
+#endif\r
+#if defined(USE_CANNM)\r
+#include "CanNm.h"\r
+#endif\r
+#if defined(USE_CANSM)\r
+#include "CanSM.h"\r
+#endif\r
+#if defined(USE_UDPNM)\r
+#include "UdpNm.h"\r
+#endif\r
+#if defined(USE_LINSM)\r
+#include "LinSM.h"\r
+#endif\r
+#if defined(USE_SPI)\r
+#include "Spi.h"\r
+#endif\r
+#if defined(USE_WDG)\r
+#include "Wdg.h"\r
+#endif\r
+#if defined(USE_WDGM)\r
+#include "WdgM.h"\r
+#endif\r
+\r
+#define VALIDATE_STATE(_state) \\r
+       do { \\r
+               EcuM_StateType ecuMState;  \\r
+               EcuM_GetState(&ecuMState); \\r
+               assert(ecuMState == (_state) ); \\r
+       } while(0)\r
+\r
+\r
+void EcuM_AL_DriverInitZero(void)\r
+{\r
+       Det_Init();/** @req EcuM2783 */\r
+    Det_Start();/** @req EcuM2634 */\r
+}\r
+\r
+extern EcuM_ConfigType EcuMConfig;\r
+\r
+EcuM_ConfigType* EcuM_DeterminePbConfiguration(void)\r
+{\r
+       return &EcuMConfig;\r
+}\r
+\r
+void EcuM_AL_DriverInitOne(const EcuM_ConfigType *ConfigPtr)\r
+{\r
+       (void)ConfigPtr;\r
+  //lint --e{715}       PC-Lint (715) - ConfigPtr usage depends on configuration of modules\r
+\r
+#if defined(USE_MCU)\r
+       Mcu_Init(ConfigPtr->McuConfig);\r
+\r
+       /* Set up default clock (Mcu_InitClock requires initRun==1) */\r
+       /* Ignoring return value */\r
+       (void) Mcu_InitClock( ConfigPtr->McuConfig->McuDefaultClockSettings );\r
+\r
+       // Wait for PLL to sync.\r
+       while (Mcu_GetPllStatus() != MCU_PLL_LOCKED)\r
+       {\r
+         ;\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
+#if defined(USE_WDG)\r
+       Wdg_Init(ConfigPtr->WdgConfig);\r
+#endif\r
+#if defined(USE_WDGM)\r
+       WdgM_Init(ConfigPtr->WdgMConfig);\r
+#endif\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
+       (void)ConfigPtr;\r
+  //lint --e{715}       PC-Lint (715) - ConfigPtr usage depends on configuration of modules\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
+       Fls_Init(ConfigPtr->FlashConfig);\r
+#endif\r
+\r
+#if defined(USE_FEE)\r
+       // Setup FEE\r
+       Fee_Init();\r
+#endif\r
+\r
+#if defined(USE_EA)\r
+       // Setup EA\r
+       Ea_Init();\r
+#endif\r
+\r
+#if defined(USE_NVM)\r
+       // Setup NVRAM Manager and start the read all job\r
+       NvM_Init();\r
+       NvM_ReadAll();\r
+#endif\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
+\r
+#if defined(USE_CANSM)\r
+        CanSM_Init(ConfigPtr->CanSMConfig);\r
+#endif\r
+\r
+#if defined(USE_J1939TP)\r
+       // Setup J1939Tp\r
+       J1939Tp_Init(ConfigPtr->J1939TpConfig);\r
+#endif\r
+\r
+\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_CANNM)\r
+        // Setup Can Network Manager\r
+        CanNm_Init(ConfigPtr->CanNmConfig);\r
+#endif\r
+\r
+#if defined(USE_UDPNM)\r
+        // Setup Udp Network Manager\r
+        UdpNm_Init(ConfigPtr->UdpNmConfig);\r
+#endif\r
+\r
+#if defined(USE_NM)\r
+        // Setup Network Management Interface\r
+        Nm_Init(ConfigPtr->NmConfig);\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
+       (void)ConfigPtr;\r
+  //lint --e{715}       PC-Lint (715) - ConfigPtr usage depends on configuration of modules\r
+\r
+#if defined(USE_DEM)\r
+       // Setup DEM\r
+       Dem_Init();\r
+#endif\r
+\r
+#if defined(USE_COMM)\r
+        // Setup Communication Manager\r
+        ComM_Init(ConfigPtr->ComMConfig);\r
+#endif\r
+}\r
+\r
+void EcuM_OnEnterRun(void)\r
+{\r
+\r
+}\r
+\r
+void EcuM_OnExitRun(void)\r
+{\r
+\r
+}\r
+\r
+void EcuM_OnExitPostRun(void)\r
+{\r
+\r
+}\r
+\r
+void EcuM_OnPrepShutdown(void)\r
+{\r
+\r
+}\r
+\r
+void EcuM_OnGoSleep(void)\r
+{\r
+\r
+}\r
+\r
+void EcuM_OnGoOffOne(void)\r
+{\r
+\r
+}\r
+\r
+void EcuM_OnGoOffTwo(void)\r
+{\r
+\r
+}\r
+\r
+void EcuM_AL_SwitchOff(void)\r
+{\r
+\r
+}\r
+\r
+void EcuM_CheckWakeup(EcuM_WakeupSourceType source) {\r
+}\r
+\r
+void EcuM_EnableWakeupSources( EcuM_WakeupSourceType source ) {\r
+}\r
+\r
+void EcuM_DisableWakeupSources(EcuM_WakeupSourceType wakeupSource) {\r
+}\r
+\r
+\r
+/**\r
+ *\r
+ *\r
+ *\r
+ * @param wakeupSource\r
+ */\r
+void EcuM_StartWakeupSources(EcuM_WakeupSourceType wakeupSource) {\r
+       VALIDATE_STATE( ECUM_STATE_WAKEUP_VALIDATION );\r
+\r
+}\r
+\r
+\r
+/**\r
+ * Restart drivers..\r
+ */\r
+void EcuM_AL_DriverRestart( void ) {\r
+\r
+       VALIDATE_STATE( ECUM_STATE_WAKEUP_VALIDATION );\r
+\r
+}\r
+\r
+\r
+/**\r
+ *\r
+ * @param wact\r
+ * @return\r
+ */\r
+EcuM_WakeupReactionType EcuM_OnWakeupReaction( EcuM_WakeupReactionType wact ) {\r
+\r
+       VALIDATE_STATE( ECUM_STATE_WAKEUP_REACTION );\r
+\r
+       return wact;\r
+}\r
+\r
+/**\r
+ * Generate RAM hash.\r
+ * We are in ECUM_STATE_SLEEP here.\r
+ *\r
+ */\r
+void EcuM_GenerateRamHash( void ) {\r
+       VALIDATE_STATE( ECUM_STATE_SLEEP );\r
+}\r
+\r
+/**\r
+ * Check RAM hash.\r
+ * We are still in ECUM_STATE_SLEEP here.\r
+ *\r
+ * @return\r
+ */\r
+uint8 EcuM_CheckRamHash( void ) {\r
+       VALIDATE_STATE( ECUM_STATE_SLEEP );\r
+\r
+       return 0;\r
+}\r
+\r
+\r
+\r