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!
30 * @ingroup globalHeaders
32 * @brief System configuration defines
34 * This holds various hash defined configuration constants and literals.
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
44 // Custom builds config setup, makes usage more clear and robust
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 // Looking forward to there being links to threads here soon! In no particular order:
63 //#define SECRETSQUIRREL // Shhhhhh! :-p
65 //#define MICROTECHSUCKS // Yes, that's you, John "I love MicroTech" Tramp
66 //#define QUAKE86 // Yep, this one too! :-)
68 //#define DAILYRAVAGE // No pun intended!
69 //#define QUICKRAVAGE // No pun intended here either!
70 // No pressure guys! <cough, cough> :-)
72 // Convert labels into IDs for use in code and set the ID string
74 #warning "CONFIG variable already defined! Manual use not advised!"
76 #define CONFIG DEFAULT_ID
77 #define PRELIM_CONFIG "Default"
79 #define CONFIG TRUCK_ID
80 #define PRELIM_CONFIG "TRUCK"
82 #define CONFIG HOTEL_ID
83 #define PRELIM_CONFIG "HOTEL"
85 #define CONFIG PRESTO_ID
86 #define PRELIM_CONFIG "PRESTO"
87 #elif defined SEANKLT1
88 #define CONFIG SEANKLT1_ID
89 #define PRELIM_CONFIG "SEANKLT1"
90 #elif defined SNOTROCKET
91 #define CONFIG SNOTROCKET_ID
92 #define PRELIM_CONFIG "SNOTROCKET"
94 #define CONFIG SPUDMN_ID
95 #define PRELIM_CONFIG "SPUDMN"
97 #define CONFIG SLATER_ID
98 #define PRELIM_CONFIG "SLATER"
99 #elif defined PETERJSERIES
100 #define CONFIG PETERJSERIES_ID
101 #define PRELIM_CONFIG "PETERJSERIES"
102 #elif defined DEUCECOUPE
103 #define CONFIG DEUCECOUPE_ID
104 #define PRELIM_CONFIG "DEUCECOUPE"
105 #elif defined PETERTRUCK
106 #define CONFIG PETERTRUCK_ID
107 #define PRELIM_CONFIG "PETERTRUCK"
108 #elif defined CLIFLAGS && !(defined XGATE)
109 #error "CLIFLAGS defined, but no build matched! Not allowing config to fall back to default!"
112 #define CONFIG DEFAULT_ID
113 #define PRELIM_CONFIG "Default"
116 // Ensure we didn't end up with config undefined or defined as zero
118 #warning "CONFIG variable has value of zero, which it has without being defined, this is not allowed!"
122 // Make sure people know what they're getting themselves in for
124 #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
125 #define BUILD_CONFIG PRELIM_CONFIG "-XGATE"
128 #define BUILD_CONFIG PRELIM_CONFIG
132 // Scheduling stuff used in configuration and scheduler
133 #define MAX_NUMBER_OF_OUTPUT_EVENTS 24
134 #define INJECTION_CHANNELS 6 /* How many injection channels the code should support */
136 /* The TX and RX buffers are slightly larger than 2k because the RX buffer */
137 /* needs to also receive a header, checksum and attributes for the data */
138 /* involved and the TX buffer needs to handle all of those two fold. */
139 #define TX_BUFFER_SIZE 0x0820 ///< 2k of data plus double maximum header overhead for echo
140 #define RX_BUFFER_SIZE 0x0810 ///< 2k of data plus maximum header overhead
143 #define ADC_NUMBER_OF_VALUES 1024 ///< Number of distinct values in 10 bit ADC units
144 #define ADC_DIVISIONS (ADC_NUMBER_OF_VALUES - 1) ///< The number of gaps between the values
145 #define ADC_MAX_VALUE (ADC_NUMBER_OF_VALUES - 1) ///< The highest value used in our mode
149 /* let us know if we are being untidy with headers */
150 #warning "Header file SYSTEM_CONFIG_H seen before, sort it out!"
151 /* end of the wrapper ifdef from the very top */