1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
24 /* Link time config */
\r
26 #include "Std_Types.h"
\r
41 extern void os_exception_IVPR();
\r
42 extern void os_exception_IVOR10();
\r
43 // The OS startup hook
\r
46 void StartupHook( void ) {
\r
48 // There a several things we need to connect here
\r
49 // * counter id for the system counter is 0
\r
50 // * that need to be attached to Gpt
\r
51 // --> We need to tell the OS that what Gpt channel it's
\r
52 // counter is connected to.
\r
54 // TODO: We need counter information here..
\r
55 // How do I get that information from the OS???
\r
57 //? GetCounterAlarmBase()
\r
59 // Gpt_StartTimer(GPT_CHANNEL_DEC, 100 );
\r
60 // Gpt_EnableNotification(GPT_CHANNEL_DEC);
\r
65 extern void os_system_timer( void );
\r
67 void EcuM_Init( void );
\r
74 void EcuM_Init( void ) {
\r
75 /* Call all mandatory interfaces, see 8.7.1 */
\r
77 /* I'm giving up on the MCU configuration. From what I
\r
78 * can tell from the documentation the Mcu_Init()
\r
82 ComM_ConfigType comMConfig;
\r
83 WdgM_ConfigType wdgmConfig;
\r
88 const Mcu_ConfigType mcuConfig;
\r
89 Mcu_Init(&mcuConfig);
\r
91 // Mcu_GetResetReason();
\r
95 EcuM_AL_DriverInitOne();
\r
100 // If we assume the OS will require SYSTEM_COUNTER to function.
\r
101 // We should either get the values from SYSTEM_COUNTER
\r
103 Gpt_ConfigType GptConfigData[] =
\r
105 .GptChannelId = GPT_CHANNEL_DEC,
\r
106 .GptChannelMode = GPT_MODE_CONTINUOUS,
\r
107 .GptChannelClkSrc = 0,
\r
108 .GptNotification = os_system_timer,
\r
111 Gpt_Init(&GptConfigData[0]);
\r
113 // The timer is actually started in StartupHook()
\r
117 // EcuM_SelectShutdownTarget(target,mode);
\r
120 //EcuM_AL_DriverInitTwo();
\r
123 ComM_Init(&comMConfig);
\r
124 WdgM_Init(&wdgmConfig);
\r
128 NvM_CancelWriteAll();
\r
133 Dem_EventIdType id = 0;
\r
134 Dem_EventStatusType status = 0;
\r
135 Dem_ReportErrorStatus(id,status);
\r
142 EnableAllInterrupts();
\r
143 DisableAllInterrupts();
\r
145 // Det_ReportError(1,2,3,4);
\r
148 void EcuM_Shutdown( void ) {
\r
152 void EcuM_GetVersionInfo( Std_VersionInfoType *versioninfo ) {
\r