1 /* FreeEMS - the open source engine management system
3 * Copyright 2012 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!
29 * @ingroup interruptHandlers
30 * @ingroup enginePositionRPMDecoders
32 * @brief For evenly spaced teeth on the camshaft with a single second input.
34 * This is suitable for engines such as the GM DIS Wasted Spark Ignition engines
35 * with 3x TACH output which would equal 3 teeth on the crank
36 * and equal for something with 6 on the cam. Sync is provided by the second
37 * input from the CAM 1x sensor allowing a sequential and/or COP/CNP setup to be used.
39 * @see EvenTeeth-Both-Nand1.c
45 #define DECODER_IMPLEMENTATION_C
46 #define DECODER_MAX_CODE_TIME 100 // To be optimised (shortened)!
47 #define NUMBER_OF_REAL_EVENTS 6
48 #define NUMBER_OF_VIRTUAL_EVENTS 6
50 #include "../inc/freeEMS.h"
51 #include "../inc/utils.h"
52 #include "../inc/interrupts.h"
53 #include "../inc/decoderInterface.h"
55 const unsigned short eventAngles
[] = {ANGLE(0), ANGLE(120), ANGLE(240), ANGLE(360), ANGLE(480), ANGLE(600)};
56 const unsigned char eventValidForCrankSync
[] = {1,1,1,1,1,1}; // Unused for now, but correct anyway.
58 // Bring in the actual code.
59 #include "code/EvenTeeth-Both-Xand1.c"