FreeEMS  0.2.0-SNAPSHOT-285-g028e24c
HallOrOptical-Distributor-4of64.c
Go to the documentation of this file.
1 /* FreeEMS - the open source engine management system
2  *
3  * Copyright 2011-2014 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  * @ingroup interruptHandlers
30  * @ingroup enginePositionRPMDecoders
31  *
32  * @brief Echos the input on the first ignition output
33  *
34  * This decoder is for unlocked distributor cars such as the MIGHTY Hyundai
35  * that I've been living in for 6 months. The mechanical distributor continues
36  * to set the timing, the ECU just logs RPM and MAP and any other senors and/or
37  * solenoids you hook up and configure.
38  *
39  * No plugs cranking LA test results:
40  *
41 
42 17302
43 17346
44 17451
45 17498
46 17600
47 17646
48 17751
49 17795
50 17900
51 
52 0
53 44
54 149
55 196
56 298
57 344
58 449
59 493
60 598
61 
62 0
63 52.98
64 179.4
65 235.99
66 358.8
67 414.18
68 540.6
69 593.58
70 720
71 
72 52.98
73 126.42
74 56.59
75 122.81
76 55.38
77 126.42
78 52.98
79 126.42
80 
81 54.48
82 125.52
83 
84 54,126
85 
86  *
87  * Approximately 1000 samples per second
88  */
89 
90 
91 #define DECODER_IMPLEMENTATION_C
92 #define DECODER_MAX_CODE_TIME 150 // To be optimised (shortened)!
93 #define NUMBER_OF_REAL_EVENTS 2 // TODO All three of these should migrate to a generic 4 cyl header...
94 #define NUMBER_OF_VIRTUAL_EVENTS 8 // TODO All three of these should migrate to a generic 4 cyl header...
95 
96 #include "../inc/freeEMS.h"
97 #include "../inc/interrupts.h"
98 #include "../inc/decoderInterface.h"
99 #include "../inc/utils.h"
100 
101 #define E1 (64 * ANGLE_FACTOR)
102 
103