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
31 //#define USE_LDEBUG_PRINTF // Uncomment this to turn debug statements on.
\r
34 void OsIdle( void ) {
\r
39 void ComTask( void ) {
\r
40 // Run COM scheduled functions.
\r
41 Com_MainFunctionTx();
\r
42 Com_MainFunctionRx();
\r
47 void ReadSwitches( void ) {
\r
48 // Trigger update of switch readings
\r
49 Adc_StartGroupConversion(ADC_SWITCHES); // Read the switches
\r
50 Adc_StartGroupConversion(ADC_POTENTIOMETERS);
\r
56 * This is the startup task. It is activated once immediately after the OS i started.
\r
58 void StartupTask( void ) {
\r
60 // Call second phase of startup sequence.
\r
63 // Startup CanIf due to ComM is missing in this example
\r
64 CanIf_InitController(CANIF_CHANNEL_0, CANIF_CHANNEL_0_CONFIG_0);
\r
65 CanIf_SetControllerMode(CANIF_CHANNEL_0, CANIF_CS_STARTED);
\r
67 // Make sure that the right PDU-groups are ready for communication.
\r
68 Com_IpduGroupStart(TxGroup, 0);
\r
70 // End of startup_task().
\r