00001 /* FreeEMS - the open source engine management system 00002 * 00003 * Copyright 2008, 2009 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 00026 00042 #include "inc/freeEMS.h" 00043 00044 00045 //unsigned char asyncDatalogType = asyncDatalogBasic; 00046 unsigned char asyncDatalogType = asyncDatalogBasic; 00047 00048 unsigned short tachoPeriod = 65535; /* Lowest RPM at start up time. */ 00049 00050 // Values for testing 00051 unsigned short masterPulseWidth = 10; 00052 unsigned short totalAngleAfterReferenceIgnition = 540; 00053 unsigned short totalAngleAfterReferenceInjection = 180; 00054 00055 /* Setup the pointers to the registers for fueling use, this does NOT work if done in global.c, I still don't know why. */ 00056 // injectorMainTimeRegisters[0] = TC2_ADDR; 00057 // injectorMainTimeRegisters[1] = TC3_ADDR; 00058 // injectorMainTimeRegisters[2] = TC4_ADDR; 00059 // injectorMainTimeRegisters[3] = TC5_ADDR; 00060 // injectorMainTimeRegisters[4] = TC6_ADDR; 00061 // injectorMainTimeRegisters[5] = TC7_ADDR; 00062 // injectorMainControlRegisters[0] = TCTL2_ADDR; 00063 // injectorMainControlRegisters[1] = TCTL2_ADDR; 00064 // injectorMainControlRegisters[2] = TCTL1_ADDR; 00065 // injectorMainControlRegisters[3] = TCTL1_ADDR; 00066 // injectorMainControlRegisters[4] = TCTL1_ADDR; 00067 // injectorMainControlRegisters[5] = TCTL1_ADDR; 00068 00069 // 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 00070 00071 /* Setup so that the tacho reads low when the engine isn't running */ 00072 unsigned long engineCyclePeriod = ticksPerCycleAtOneRPM;