FreeEMS  0.2.0-SNAPSHOT-285-g028e24c
systemConfig.h
Go to the documentation of this file.
1 /* FreeEMS - the open source engine management system
2  *
3  * Copyright 2012-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 allHeaders
30  * @ingroup globalHeaders
31  *
32  * @brief System configuration defines
33  *
34  * This holds various hash defined configuration constants and literals.
35  */
36 
37 
38 /* Header file multiple inclusion protection courtesy eclipse Header Template */
39 /* and http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/ C pre processor manual */
40 #ifndef FILE_SYSTEM_CONFIG_H_SEEN
41 #define FILE_SYSTEM_CONFIG_H_SEEN
42 
43 
44 // Custom builds config setup, makes usage more clear and robust
45 
46 // Vehicle IDs to avoid typos
47 #define DEFAULT_ID 1 // RIP original Volvo! (should have been 1)
48 #define TRUCK_ID 2 // Won't be in use for some time!
49 #define HOTEL_ID 3 // So reliable, we've not heard from him in months
50 #define PRESTO_ID 4 // Lost in service
51 #define SEANKLT1_ID 5 // Driven yearly, maybe
52 //efine MARCOS_ID 6 // Only idled for one minute, never since. No config available for this vehicle. http://forum.diyefi.org/viewtopic.php?f=55&t=1303
53 #define SNOTROCKET_ID 7 // Another one that's too reliable
54 #define SPUDMN_ID 8 // Occasionally comes out of the garage to race
55 #define SLATER_ID 9 // Occasionally comes out of the garage to do burnouts
56 #define PETERJSERIES_ID 10 // Winter thrasher, works so well he refuses to whinge
57 #define DEUCECOUPE_ID 11 // Work in progress, ignition not setup yet
58 #define PETERTRUCK_ID 12 // Work horse vehicle, about to get boosted
59 //efine PIOLIN_ID 13 // Project unlucky
60 //efine MIKEC383_ID 14 // Mike's 1987 383 V8 Camaro
61 #define SCAVENGER_ID 15 // Hacked up Miata turbo from the south!
62 #define DEUCES10_ID 16 // Work in progress
63 //efine SEANKR1_ID 17 // Sean's R1 Turbo powered desert rail
64 //efine HOTCAT_ID 18 // HotCat's Citroen ZX
65 //efine ELITH_ER12_ID 19 // Elith Racing's 2006 CBR600F engine
66 //efine ELITH_ER13_ID 20 // Elith Racing's 2007 CBR600RR powered FSAE car
67 //efine ONIONMOBILE_ID 21 // MrOnion's MK2 Golf GTI
68 //efine VOLVERC_ID 22 // Em-knaps' 1994 B5234T Volvo engine
69 //efine TOXICTACOMA_ID 23 // Jeff's 2003 Toyota Tacoma
70 //efine AITOR51_ID 24 // Aitor's 1992 Sierra XR4i 2.0 Turbo
71 //efine MATTHIJS309T_ID 25 // Matthijs' Peugeot 309 2.0 Turbo
72 //efine WIKISPEEDR18_ID 26 // WikiSpeed's first car with R18A1 Honda
73 //efine JOSHSB18MINI_ID 27 // Josh's LS-VTEC powered Mini
74 //efine BMSTBO_ID 28 // Piimae's E7 Corolla w/ 4A-GE 16V turbo
75 
76 
77 // Convert labels into IDs for use in code and set the ID string
78 #ifdef CONFIG
79 #warning "CONFIG variable already defined! Manual use not advised!"
80 #elif defined DEFAULT
81 #define CONFIG DEFAULT_ID
82 #define PRELIM_CONFIG "Default"
83 #elif defined TRUCK
84 #define CONFIG TRUCK_ID
85 #define PRELIM_CONFIG "TRUCK"
86 #elif defined HOTEL
87 #define CONFIG HOTEL_ID
88 #define PRELIM_CONFIG "HOTEL"
89 #elif defined PRESTO
90 #define CONFIG PRESTO_ID
91 #define PRELIM_CONFIG "PRESTO"
92 #elif defined SEANKLT1
93 #define CONFIG SEANKLT1_ID
94 #define PRELIM_CONFIG "SEANKLT1"
95 #elif defined SNOTROCKET
96 #define CONFIG SNOTROCKET_ID
97 #define PRELIM_CONFIG "SNOTROCKET"
98 #elif defined SPUDMN
99 #define CONFIG SPUDMN_ID
100 #define PRELIM_CONFIG "SPUDMN"
101 #elif defined SLATER
102 #define CONFIG SLATER_ID
103 #define PRELIM_CONFIG "SLATER"
104 #elif defined PETERJSERIES
105 #define CONFIG PETERJSERIES_ID
106 #define PRELIM_CONFIG "PETERJSERIES"
107 #elif defined DEUCECOUPE
108 #define CONFIG DEUCECOUPE_ID
109 #define PRELIM_CONFIG "DEUCECOUPE"
110 #elif defined PETERTRUCK
111 #define CONFIG PETERTRUCK_ID
112 #define PRELIM_CONFIG "PETERTRUCK"
113 #elif defined PIOLIN
114 #define CONFIG PIOLIN_ID
115 #define PRELIM_CONFIG "PIOLIN"
116 #elif defined MIKEC383
117 #define CONFIG MIKEC383_ID
118 #define PRELIM_CONFIG "MIKEC383"
119 #elif defined SCAVENGER
120 #define CONFIG SCAVENGER_ID
121 #define PRELIM_CONFIG "SCAVENGER"
122 #elif defined DEUCES10
123 #define CONFIG DEUCES10_ID
124 #define PRELIM_CONFIG "DEUCES10"
125 #elif defined SEANKR1
126 #define CONFIG SEANKR1_ID
127 #define PRELIM_CONFIG "SEANKR1"
128 #elif defined HOTCAT
129 #define CONFIG HOTCAT_ID
130 #define PRELIM_CONFIG "HOTCAT"
131 #elif defined ELITH_ER12
132 #define CONFIG ELITH_ER12_ID
133 #define PRELIM_CONFIG "ELITH_ER12"
134 #elif defined ELITH_ER13
135 #define CONFIG ELITH_ER13_ID
136 #define PRELIM_CONFIG "ELITH_ER13"
137 #elif defined ONIONMOBILE
138 #define CONFIG ONIONMOBILE_ID
139 #define PRELIM_CONFIG "ONIONMOBILE"
140 #elif defined VOLVERC
141 #define CONFIG VOLVERC_ID
142 #define PRELIM_CONFIG "VOLVERC"
143 #elif defined TOXICTACOMA
144 #define CONFIG TOXICTACOMA_ID
145 #define PRELIM_CONFIG "TOXICTACOMA"
146 #elif defined AITOR51
147 #define CONFIG AITOR51_ID
148 #define PRELIM_CONFIG "AITOR51"
149 #elif defined MATTHIJS309T
150 #define CONFIG MATTHIJS309T_ID
151 #define PRELIM_CONFIG "MATTHIJS309T"
152 #elif defined WIKISPEEDR18
153 #define CONFIG WIKISPEEDR18_ID
154 #define PRELIM_CONFIG "WIKISPEEDR18"
155 #elif defined JOSHSB18MINI
156 #define CONFIG JOSHSB18MINI_ID
157 #define PRELIM_CONFIG "JOSHSB18MINI"
158 #elif defined BMSTBO
159 #define CONFIG BMSTBO_ID
160 #define PRELIM_CONFIG "BMSTBO"
161 #elif defined CLIFLAGS && !(defined XGATE)
162 #error "CLIFLAGS defined, but no build matched! Not allowing config to fall back to default!"
163 #define CONFIG -1
164 #else
165 #define CONFIG DEFAULT_ID
166 #define PRELIM_CONFIG "Default"
167 #endif
168 
169 // Ensure we didn't end up with config undefined or defined as zero
170 #if CONFIG == 0
171 #warning "CONFIG variable has value of zero, which it has without being defined, this is not allowed!"
172 #endif
173 
174 
175 // Make sure people know what they're getting themselves in for
176 #ifdef XGATE
177 #warning "XGATE is currently not recommended, nor thoroughly tested! Use at your own risk and without support! goo.gl/LCOMR" // Remove this line to build. See http://forum.diyefi.org/viewtopic.php?f=8&t=1700
178 #define BUILD_CONFIG PRELIM_CONFIG "-XGATE"
179 
180 #else
181 #define BUILD_CONFIG PRELIM_CONFIG
182 #endif
183 
184 
185 // Scheduling stuff used in configuration and scheduler
186 #define MAX_NUMBER_OF_OUTPUT_EVENTS 24
187 #define ECT_CHANNELS 6 /* How many ECT channels the code should support */
188 
189 /* The TX and RX buffers are slightly larger than 2k because the RX buffer */
190 /* needs to also receive a header, checksum and attributes for the data */
191 /* involved and the TX buffer needs to handle all of those two fold. */
192 #define TX_BUFFER_SIZE 0x0820 ///< 2k of data plus double maximum header overhead for echo
193 #define RX_BUFFER_SIZE 0x0810 ///< 2k of data plus maximum header overhead
194 
195 // ADC values
196 #define ADC_NUMBER_OF_VALUES 1024 ///< Number of distinct values in 10 bit ADC units
197 #define ADC_DIVISIONS (ADC_NUMBER_OF_VALUES - 1) ///< The number of gaps between the values
198 #define ADC_MAX_VALUE (ADC_NUMBER_OF_VALUES - 1) ///< The highest value used in our mode
199 
200 
201 #else
202  /* let us know if we are being untidy with headers */
203  #warning "Header file SYSTEM_CONFIG_H seen before, sort it out!"
204 /* end of the wrapper ifdef from the very top */
205 #endif