-/* -------------------------------- 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