FreeEMS  0.2.0-SNAPSHOT-285-g028e24c
injectionISRs.c
Go to the documentation of this file.
1 /* FreeEMS - the open source engine management system
2  *
3  * Copyright 2008-2012 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  *
31  * @brief Injection ISR substitutions
32  *
33  * This file defines the pin specific names for each interrupt and all of it's
34  * pin specific variables then imports the actual code from inc/injectorISR.c
35  * for each pin such that each one is unique and references a separate set of
36  * values specific to it while only maintaining a single copy of the code.
37  *
38  * @see injectorISR.c
39  */
40 
41 
42 #define INJECTIONISRS_C
43 #include "inc/freeEMS.h"
44 #include "inc/interrupts.h"
45 #include "inc/decoderInterface.h"
46 
47 
48 /* Staged control algorithms for PIT2 and PIT3 */
49 /* Staged injection switch on timer */
50 void StagedOnISR(void){
51  // clear the flag
52  PITINTE |= 0x04;
53  /// @todo TODO This will be handled by XGATE, somehow, in the mean time, move to UISR file along with others.
54 }
55 
56 /* Staged injection switch off timer */
57 void StagedOffISR(void){
58  // clear the flag
59  PITINTE |= 0x08;
60  /// @todo TODO This will be handled by XGATE, somehow, in the mean time, move to UISR file along with others.
61 }
62 
63 
64 /* Define the variables correctly for each channel then import the code */
65 
66 /* Channel 1 */
67 #define INJECTOR_CHANNEL_NUMBER 0
68 #define InjectorXISR Injector1ISR
69 #include "inc/injectorISR.c"
70 #undef InjectorXISR
71 #undef INJECTOR_CHANNEL_NUMBER
72 
73 /* Channel 2 */
74 #define INJECTOR_CHANNEL_NUMBER 1
75 #define InjectorXISR Injector2ISR
76 #include "inc/injectorISR.c"
77 #undef InjectorXISR
78 #undef INJECTOR_CHANNEL_NUMBER
79 
80 /* Channel 3 */
81 #define INJECTOR_CHANNEL_NUMBER 2
82 #define InjectorXISR Injector3ISR
83 #include "inc/injectorISR.c"
84 #undef InjectorXISR
85 #undef INJECTOR_CHANNEL_NUMBER
86 
87 /* Channel 4 */
88 #define INJECTOR_CHANNEL_NUMBER 3
89 #define InjectorXISR Injector4ISR
90 #include "inc/injectorISR.c"
91 #undef InjectorXISR
92 #undef INJECTOR_CHANNEL_NUMBER
93 
94 /* Channel 5 */
95 #define INJECTOR_CHANNEL_NUMBER 4
96 #define InjectorXISR Injector5ISR
97 #include "inc/injectorISR.c"
98 #undef InjectorXISR
99 #undef INJECTOR_CHANNEL_NUMBER
100 
101 /* Channel 6 */
102 #define INJECTOR_CHANNEL_NUMBER 5
103 #define InjectorXISR Injector6ISR
104 #include "inc/injectorISR.c"
105 #undef InjectorXISR
106 #undef INJECTOR_CHANNEL_NUMBER