1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
24 /* Link time config */
\r
26 #warning "This default file may only be used as an example!"
\r
28 #include "Std_Types.h"
\r
43 extern void os_exception_IVPR();
\r
44 extern void os_exception_IVOR10();
\r
45 // The OS startup hook
\r
48 void StartupHook( void ) {
\r
50 // There a several things we need to connect here
\r
51 // * counter id for the system counter is 0
\r
52 // * that need to be attached to Gpt
\r
53 // --> We need to tell the OS that what Gpt channel it's
\r
54 // counter is connected to.
\r
56 // TODO: We need counter information here..
\r
57 // How do I get that information from the OS???
\r
59 //? GetCounterAlarmBase()
\r
61 // Gpt_StartTimer(GPT_CHANNEL_DEC, 100 );
\r
62 // Gpt_EnableNotification(GPT_CHANNEL_DEC);
\r
67 extern void os_system_timer( void );
\r
69 void EcuM_Init( void );
\r
76 void EcuM_Init( void ) {
\r
77 /* Call all mandatory interfaces, see 8.7.1 */
\r
79 /* I'm giving up on the MCU configuration. From what I
\r
80 * can tell from the documentation the Mcu_Init()
\r
84 ComM_ConfigType comMConfig;
\r
85 WdgM_ConfigType wdgmConfig;
\r
90 const Mcu_ConfigType mcuConfig;
\r
91 Mcu_Init(&mcuConfig);
\r
93 // Mcu_GetResetReason();
\r
96 #if defined(USE_DEM)
\r
99 EcuM_AL_DriverInitOne();
\r
104 // If we assume the OS will require SYSTEM_COUNTER to function.
\r
105 // We should either get the values from SYSTEM_COUNTER
\r
107 Gpt_ConfigType GptConfigData[] =
\r
109 .GptChannelId = GPT_CHANNEL_DEC,
\r
110 .GptChannelMode = GPT_MODE_CONTINUOUS,
\r
111 .GptChannelClkSrc = 0,
\r
112 .GptNotification = os_system_timer,
\r
115 Gpt_Init(&GptConfigData[0]);
\r
117 // The timer is actually started in StartupHook()
\r
121 // EcuM_SelectShutdownTarget(target,mode);
\r
122 StartOS(OSDEFAULTAPPMODE);
\r
124 //EcuM_AL_DriverInitTwo();
\r
127 ComM_Init(&comMConfig);
\r
128 WdgM_Init(&wdgmConfig);
\r
132 NvM_CancelWriteAll();
\r
134 #if defined(USE_DEM)
\r
138 Dem_EventIdType id = 0;
\r
139 Dem_EventStatusType status = 0;
\r
140 Dem_ReportErrorStatus(id,status);
\r
148 EnableAllInterrupts();
\r
149 DisableAllInterrupts();
\r
151 // Det_ReportError(1,2,3,4);
\r
154 void EcuM_Shutdown( void ) {
\r
158 void EcuM_GetVersionInfo( Std_VersionInfoType *versioninfo ) {
\r