00001 /* FreeEMS - the open source engine management system 00002 00003 Copyright 2008 Fred Cooke 00004 00005 This file is part of the FreeEMS project. 00006 00007 FreeEMS software is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 FreeEMS software is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with any FreeEMS software. If not, see http://www.gnu.org/licenses/ 00019 00020 We ask that if you make any changes to this file you email them upstream to 00021 us at admin(at)diyefi(dot)org or, even better, fork the code on github.com! 00022 00023 Thank you for choosing FreeEMS to run your engine! */ 00024 00025 00039 #include "inc/freeEMS.h" 00040 00041 00042 //unsigned char asyncDatalogType = asyncDatalogBasic; 00043 unsigned char asyncDatalogType = asyncDatalogBasic; 00044 00045 unsigned short tachoPeriod = 65535; /* Lowest RPM at start up time. */ 00046 00047 // Values for testing 00048 unsigned short masterPulseWidth = 10; 00049 unsigned short totalAngleAfterReferenceIgnition = 540; 00050 unsigned short totalAngleAfterReferenceInjection = 180; 00051 00052 /* Setup the pointers to the registers for fueling use, this does NOT work if done in global.c, I still don't know why. */ 00053 // injectorMainTimeRegisters[0] = TC2_ADDR; 00054 // injectorMainTimeRegisters[1] = TC3_ADDR; 00055 // injectorMainTimeRegisters[2] = TC4_ADDR; 00056 // injectorMainTimeRegisters[3] = TC5_ADDR; 00057 // injectorMainTimeRegisters[4] = TC6_ADDR; 00058 // injectorMainTimeRegisters[5] = TC7_ADDR; 00059 // injectorMainControlRegisters[0] = TCTL2_ADDR; 00060 // injectorMainControlRegisters[1] = TCTL2_ADDR; 00061 // injectorMainControlRegisters[2] = TCTL1_ADDR; 00062 // injectorMainControlRegisters[3] = TCTL1_ADDR; 00063 // injectorMainControlRegisters[4] = TCTL1_ADDR; 00064 // injectorMainControlRegisters[5] = TCTL1_ADDR; 00065 00066 // 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 00067 00068 /* Setup so that the tacho reads low when the engine isn't running */ 00069 unsigned long engineCyclePeriod = ticksPerCycleAtOneRPM;