FreeEMS  0.2.0-SNAPSHOT-285-g028e24c
staticInit.c
Go to the documentation of this file.
1 /* FreeEMS - the open source engine management system
2  *
3  * Copyright 2008-2012 Fred Cooke
4  *
5  * This file is part of the FreeEMS project.
6  *
7  * FreeEMS software is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * FreeEMS software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with any FreeEMS software. If not, see http://www.gnu.org/licenses/
19  *
20  * We ask that if you make any changes to this file you email them upstream to
21  * us at admin(at)diyefi(dot)org or, even better, fork the code on github.com!
22  *
23  * Thank you for choosing FreeEMS to run your engine!
24  */
25 
26 
27 /** @file
28  *
29  * @brief Static initialisation of non-zero variables
30  *
31  * This file contains static initialisations for fields that require a non-zero
32  * initial value after reset. Zero fields are taken care of by GCC and doing
33  * this here means less init time and init code, both good things. Variables
34  * initialised here are placed together by the compiler in flash and copied up
35  * to RAM as a linear block before the main method runs. This is significantly
36  * more efficient than doing them one-by-one in an init routine.
37  */
38 
39 
40 #include "inc/freeEMS.h"
41 
42 
43 // Values for testing
44 unsigned short masterPulseWidth = 10;
45 
46  /* Setup the pointers to the registers for fueling use, this does NOT work if done in global.c, I still don't know why. */
47 // injectorMainTimeRegisters[0] = TC2_ADDR;
48 // injectorMainTimeRegisters[1] = TC3_ADDR;
49 // injectorMainTimeRegisters[2] = TC4_ADDR;
50 // injectorMainTimeRegisters[3] = TC5_ADDR;
51 // injectorMainTimeRegisters[4] = TC6_ADDR;
52 // injectorMainTimeRegisters[5] = TC7_ADDR;
53 // injectorMainControlRegisters[0] = TCTL2_ADDR;
54 // injectorMainControlRegisters[1] = TCTL2_ADDR;
55 // injectorMainControlRegisters[2] = TCTL1_ADDR;
56 // injectorMainControlRegisters[3] = TCTL1_ADDR;
57 // injectorMainControlRegisters[4] = TCTL1_ADDR;
58 // injectorMainControlRegisters[5] = TCTL1_ADDR;
59 
60 #ifdef XGATE
61 #include "xgateGlobals.c"
62 #endif