Automatically committing release files for FreeEMS version 0.1.1-XGATED!
[freeems-vanilla.git] / src / staticInit.c
blobb352840725e9ef83a16fb7e304928f0d7aaf2f7f
1 /* FreeEMS - the open source engine management system
3 * Copyright 2008, 2009 Fred Cooke
5 * This file is part of the FreeEMS project.
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.
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.
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/
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!
23 * Thank you for choosing FreeEMS to run your engine!
27 /** @file staticInit.c
29 * @brief Static initialisation of non-zero variables
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.
38 * @author Fred Cooke
42 #include "inc/freeEMS.h"
45 //unsigned char asyncDatalogType = asyncDatalogBasic;
46 unsigned char asyncDatalogType = asyncDatalogBasic;
48 unsigned short tachoPeriod = 65535; /* Lowest RPM at start up time. */
50 // Values for testing
51 unsigned short masterPulseWidth = 10;
52 unsigned short totalAngleAfterReferenceIgnition = 540;
53 unsigned short totalAngleAfterReferenceInjection = 180;
55 /* Setup the pointers to the registers for fueling use, this does NOT work if done in global.c, I still don't know why. */
56 // injectorMainTimeRegisters[0] = TC2_ADDR;
57 // injectorMainTimeRegisters[1] = TC3_ADDR;
58 // injectorMainTimeRegisters[2] = TC4_ADDR;
59 // injectorMainTimeRegisters[3] = TC5_ADDR;
60 // injectorMainTimeRegisters[4] = TC6_ADDR;
61 // injectorMainTimeRegisters[5] = TC7_ADDR;
62 // injectorMainControlRegisters[0] = TCTL2_ADDR;
63 // injectorMainControlRegisters[1] = TCTL2_ADDR;
64 // injectorMainControlRegisters[2] = TCTL1_ADDR;
65 // injectorMainControlRegisters[3] = TCTL1_ADDR;
66 // injectorMainControlRegisters[4] = TCTL1_ADDR;
67 // injectorMainControlRegisters[5] = TCTL1_ADDR;
69 // TODO perhaps read from the ds1302 once at start up and init the values or different ones with the actual time and date then update them in RTI
71 /* Setup so that the tacho reads low when the engine isn't running */
72 unsigned long engineCyclePeriod = ticksPerCycleAtOneRPM;