|
15 | 15 |
|
16 | 16 | using byte = uint8_t; |
17 | 17 |
|
18 | | -#define EGO_TYPE_OFF 0U |
19 | | -#define EGO_TYPE_NARROW 1U |
20 | | -#define EGO_TYPE_WIDE 2U |
21 | | - |
22 | | -#define INJ_TYPE_PORT 0U |
23 | | -#define INJ_TYPE_TBODY 1U |
24 | | - |
25 | | -#define INJ_PAIRED 0U |
26 | | -#define INJ_SEMISEQUENTIAL 1U |
27 | | -#define INJ_BANKED 2U |
28 | | -#define INJ_SEQUENTIAL 3U |
29 | | - |
30 | | -#define INJ_PAIR_13_24 0U |
31 | | -#define INJ_PAIR_14_23 1U |
32 | | - |
33 | | -#define IGN_MODE_WASTED 0U |
34 | | -#define IGN_MODE_SINGLE 1U |
35 | | -#define IGN_MODE_WASTEDCOP 2U |
36 | | -#define IGN_MODE_SEQUENTIAL 3U |
37 | | -#define IGN_MODE_ROTARY 4U |
38 | | - |
39 | | -#define SEC_TRIGGER_SINGLE 0U |
40 | | -#define SEC_TRIGGER_4_1 1U |
41 | | -#define SEC_TRIGGER_POLL 2U |
42 | | -#define SEC_TRIGGER_5_3_2 3U |
43 | | -#define SEC_TRIGGER_TOYOTA_3 4U |
| 18 | +constexpr uint8_t EGO_TYPE_OFF = 0U; |
| 19 | +constexpr uint8_t EGO_TYPE_NARROW = 1U; |
| 20 | +constexpr uint8_t EGO_TYPE_WIDE = 2U; |
| 21 | + |
| 22 | +constexpr uint8_t INJ_TYPE_PORT = 0U; |
| 23 | +constexpr uint8_t INJ_TYPE_TBODY = 1U; |
| 24 | + |
| 25 | +constexpr uint8_t INJ_PAIRED = 0U; |
| 26 | +constexpr uint8_t INJ_SEMISEQUENTIAL = 1U; |
| 27 | +constexpr uint8_t INJ_BANKED = 2U; |
| 28 | +constexpr uint8_t INJ_SEQUENTIAL = 3U; |
| 29 | + |
| 30 | +constexpr uint8_t INJ_PAIR_13_24 = 0U; |
| 31 | +constexpr uint8_t INJ_PAIR_14_23 = 1U; |
| 32 | + |
| 33 | +constexpr uint8_t IGN_MODE_WASTED = 0U; |
| 34 | +constexpr uint8_t IGN_MODE_SINGLE = 1U; |
| 35 | +constexpr uint8_t IGN_MODE_WASTEDCOP = 2U; |
| 36 | +constexpr uint8_t IGN_MODE_SEQUENTIAL = 3U; |
| 37 | +constexpr uint8_t IGN_MODE_ROTARY = 4U; |
| 38 | + |
| 39 | +constexpr uint8_t SEC_TRIGGER_SINGLE = 0U; |
| 40 | +constexpr uint8_t SEC_TRIGGER_4_1 = 1U; |
| 41 | +constexpr uint8_t SEC_TRIGGER_POLL = 2U; |
| 42 | +constexpr uint8_t SEC_TRIGGER_5_3_2 = 3U; |
| 43 | +constexpr uint8_t SEC_TRIGGER_TOYOTA_3 = 4U; |
44 | 44 |
|
45 | | -#define ROTARY_IGN_FC 0U |
46 | | -#define ROTARY_IGN_FD 1U |
47 | | -#define ROTARY_IGN_RX8 2U |
| 45 | +constexpr uint8_t ROTARY_IGN_FC = 0U; |
| 46 | +constexpr uint8_t ROTARY_IGN_FD = 1U; |
| 47 | +constexpr uint8_t ROTARY_IGN_RX8 = 2U; |
48 | 48 |
|
49 | | -#define BOOST_MODE_SIMPLE 0U |
50 | | -#define BOOST_MODE_FULL 1U |
| 49 | +constexpr uint8_t BOOST_MODE_SIMPLE = 0U; |
| 50 | +constexpr uint8_t BOOST_MODE_FULL = 1U; |
| 51 | + |
| 52 | +constexpr uint8_t EN_BOOST_CONTROL_BARO = 0U; |
| 53 | +constexpr uint8_t EN_BOOST_CONTROL_FIXED = 1U; |
| 54 | + |
| 55 | +constexpr uint8_t WMI_MODE_SIMPLE = 0U; |
| 56 | +constexpr uint8_t WMI_MODE_PROPORTIONAL = 1U; |
| 57 | +constexpr uint8_t WMI_MODE_OPENLOOP = 2U; |
| 58 | +constexpr uint8_t WMI_MODE_CLOSEDLOOP = 3U; |
| 59 | + |
| 60 | +constexpr uint8_t HARD_CUT_FULL = 0U; |
| 61 | +constexpr uint8_t HARD_CUT_ROLLING = 1U; |
| 62 | + |
| 63 | +constexpr uint8_t EVEN_FIRE = 0U; |
| 64 | +constexpr uint8_t ODD_FIRE = 1U; |
| 65 | + |
| 66 | +constexpr uint8_t EGO_ALGORITHM_SIMPLE = 0U; |
| 67 | +constexpr uint8_t EGO_ALGORITHM_INVALID1 = 1U; |
| 68 | +constexpr uint8_t EGO_ALGORITHM_PID = 2U; |
| 69 | +constexpr uint8_t EGO_ALGORITHM_NONE = 3U; |
| 70 | + |
| 71 | +constexpr uint8_t STAGING_MODE_TABLE = 0U; |
| 72 | +constexpr uint8_t STAGING_MODE_AUTO = 1U; |
| 73 | + |
| 74 | +constexpr uint8_t NITROUS_OFF = 0U; |
| 75 | +constexpr uint8_t NITROUS_STAGE1 = 1U; |
| 76 | +constexpr uint8_t NITROUS_STAGE2 = 2U; |
| 77 | +constexpr uint8_t NITROUS_BOTH = 3U; |
| 78 | + |
| 79 | +constexpr uint8_t PROTECT_CUT_OFF = 0U; |
| 80 | +constexpr uint8_t PROTECT_CUT_IGN = 1U; |
| 81 | +constexpr uint8_t PROTECT_CUT_FUEL = 2U; |
| 82 | +constexpr uint8_t PROTECT_CUT_BOTH = 3U; |
| 83 | +constexpr uint8_t PROTECT_IO_ERROR = 7U; |
| 84 | + |
| 85 | +constexpr uint8_t AE_MODE_TPS = 0U; |
| 86 | +constexpr uint8_t AE_MODE_MAP = 1U; |
| 87 | + |
| 88 | +constexpr uint8_t AE_MODE_MULTIPLIER = 0U; |
| 89 | +constexpr uint8_t AE_MODE_ADDER = 1U; |
| 90 | + |
| 91 | +constexpr uint8_t KNOCK_MODE_OFF = 0U; |
| 92 | +constexpr uint8_t KNOCK_MODE_DIGITAL = 1U; |
| 93 | +constexpr uint8_t KNOCK_MODE_ANALOG = 2U; |
| 94 | + |
| 95 | +constexpr uint8_t KNOCK_TRIGGER_HIGH = 0U; |
| 96 | +constexpr uint8_t KNOCK_TRIGGER_LOW = 1U; |
| 97 | + |
| 98 | +constexpr uint8_t FUEL2_MODE_OFF = 0U; |
| 99 | +constexpr uint8_t FUEL2_MODE_MULTIPLY = 1U; |
| 100 | +constexpr uint8_t FUEL2_MODE_ADD = 2U; |
| 101 | +constexpr uint8_t FUEL2_MODE_CONDITIONAL_SWITCH = 3U; |
| 102 | +constexpr uint8_t FUEL2_MODE_INPUT_SWITCH = 4U; |
| 103 | + |
| 104 | +constexpr uint8_t SPARK2_MODE_OFF = 0U; |
| 105 | +constexpr uint8_t SPARK2_MODE_MULTIPLY = 1U; |
| 106 | +constexpr uint8_t SPARK2_MODE_ADD = 2U; |
| 107 | +constexpr uint8_t SPARK2_MODE_CONDITIONAL_SWITCH = 3U; |
| 108 | +constexpr uint8_t SPARK2_MODE_INPUT_SWITCH = 4U; |
| 109 | + |
| 110 | +constexpr uint8_t FUEL2_CONDITION_RPM = 0U; |
| 111 | +constexpr uint8_t FUEL2_CONDITION_MAP = 1U; |
| 112 | +constexpr uint8_t FUEL2_CONDITION_TPS = 2U; |
| 113 | +constexpr uint8_t FUEL2_CONDITION_ETH = 3U; |
| 114 | + |
| 115 | +constexpr uint8_t SPARK2_CONDITION_RPM = 0U; |
| 116 | +constexpr uint8_t SPARK2_CONDITION_MAP = 1U; |
| 117 | +constexpr uint8_t SPARK2_CONDITION_TPS = 2U; |
| 118 | +constexpr uint8_t SPARK2_CONDITION_ETH = 3U; |
| 119 | + |
| 120 | +constexpr uint8_t RESET_CONTROL_DISABLED = 0U; |
| 121 | +constexpr uint8_t RESET_CONTROL_PREVENT_WHEN_RUNNING = 1U; |
| 122 | +constexpr uint8_t RESET_CONTROL_PREVENT_ALWAYS = 2U; |
| 123 | +constexpr uint8_t RESET_CONTROL_SERIAL_COMMAND = 3U; |
| 124 | + |
| 125 | +constexpr uint8_t OPEN_LOOP_BOOST = 0U; |
| 126 | +constexpr uint8_t CLOSED_LOOP_BOOST = 1U; |
| 127 | + |
| 128 | +constexpr uint8_t SOFT_LIMIT_FIXED = 0U; |
| 129 | +constexpr uint8_t SOFT_LIMIT_RELATIVE = 1U; |
| 130 | + |
| 131 | +constexpr uint8_t VVT_MODE_ONOFF = 0U; |
| 132 | +constexpr uint8_t VVT_MODE_OPEN_LOOP = 1U; |
| 133 | +constexpr uint8_t VVT_MODE_CLOSED_LOOP = 2U; |
| 134 | + |
| 135 | +constexpr uint8_t VVT_LOAD_MAP = 0U; |
| 136 | +constexpr uint8_t VVT_LOAD_TPS = 1U; |
| 137 | + |
| 138 | +constexpr uint8_t MULTIPLY_MAP_MODE_OFF = 0U; |
| 139 | +constexpr uint8_t MULTIPLY_MAP_MODE_BARO = 1U; |
| 140 | +constexpr uint8_t MULTIPLY_MAP_MODE_100 = 2U; |
| 141 | + |
| 142 | +constexpr uint8_t FOUR_STROKE = 0U; |
| 143 | +constexpr uint8_t TWO_STROKE = 1U; |
51 | 144 |
|
52 | | -#define EN_BOOST_CONTROL_BARO 0U |
53 | | -#define EN_BOOST_CONTROL_FIXED 1U |
| 145 | +constexpr uint8_t GOING_LOW = 0U; |
| 146 | +constexpr uint8_t GOING_HIGH = 1U; |
54 | 147 |
|
55 | | -#define WMI_MODE_SIMPLE 0U |
56 | | -#define WMI_MODE_PROPORTIONAL 1U |
57 | | -#define WMI_MODE_OPENLOOP 2U |
58 | | -#define WMI_MODE_CLOSEDLOOP 3U |
59 | | - |
60 | | -#define HARD_CUT_FULL 0U |
61 | | -#define HARD_CUT_ROLLING 1U |
62 | | - |
63 | | -#define EVEN_FIRE 0U |
64 | | -#define ODD_FIRE 1U |
65 | | - |
66 | | -#define EGO_ALGORITHM_SIMPLE 0U |
67 | | -#define EGO_ALGORITHM_INVALID1 1U |
68 | | -#define EGO_ALGORITHM_PID 2U |
69 | | -#define EGO_ALGORITHM_NONE 3U |
70 | | - |
71 | | -#define STAGING_MODE_TABLE 0U |
72 | | -#define STAGING_MODE_AUTO 1U |
73 | | - |
74 | | -#define NITROUS_OFF 0U |
75 | | -#define NITROUS_STAGE1 1U |
76 | | -#define NITROUS_STAGE2 2U |
77 | | -#define NITROUS_BOTH 3U |
78 | | - |
79 | | -#define PROTECT_CUT_OFF 0U |
80 | | -#define PROTECT_CUT_IGN 1U |
81 | | -#define PROTECT_CUT_FUEL 2U |
82 | | -#define PROTECT_CUT_BOTH 3U |
83 | | -#define PROTECT_IO_ERROR 7U |
84 | | - |
85 | | -#define AE_MODE_TPS 0U |
86 | | -#define AE_MODE_MAP 1U |
87 | | - |
88 | | -#define AE_MODE_MULTIPLIER 0U |
89 | | -#define AE_MODE_ADDER 1U |
90 | | - |
91 | | -#define KNOCK_MODE_OFF 0U |
92 | | -#define KNOCK_MODE_DIGITAL 1U |
93 | | -#define KNOCK_MODE_ANALOG 2U |
94 | | - |
95 | | -#define KNOCK_TRIGGER_HIGH 0U |
96 | | -#define KNOCK_TRIGGER_LOW 1U |
97 | | - |
98 | | -#define FUEL2_MODE_OFF 0U |
99 | | -#define FUEL2_MODE_MULTIPLY 1U |
100 | | -#define FUEL2_MODE_ADD 2U |
101 | | -#define FUEL2_MODE_CONDITIONAL_SWITCH 3U |
102 | | -#define FUEL2_MODE_INPUT_SWITCH 4U |
103 | | - |
104 | | -#define SPARK2_MODE_OFF 0U |
105 | | -#define SPARK2_MODE_MULTIPLY 1U |
106 | | -#define SPARK2_MODE_ADD 2U |
107 | | -#define SPARK2_MODE_CONDITIONAL_SWITCH 3U |
108 | | -#define SPARK2_MODE_INPUT_SWITCH 4U |
109 | | - |
110 | | -#define FUEL2_CONDITION_RPM 0U |
111 | | -#define FUEL2_CONDITION_MAP 1U |
112 | | -#define FUEL2_CONDITION_TPS 2U |
113 | | -#define FUEL2_CONDITION_ETH 3U |
114 | | - |
115 | | -#define SPARK2_CONDITION_RPM 0U |
116 | | -#define SPARK2_CONDITION_MAP 1U |
117 | | -#define SPARK2_CONDITION_TPS 2U |
118 | | -#define SPARK2_CONDITION_ETH 3U |
119 | | - |
120 | | -#define RESET_CONTROL_DISABLED 0U |
121 | | -#define RESET_CONTROL_PREVENT_WHEN_RUNNING 1U |
122 | | -#define RESET_CONTROL_PREVENT_ALWAYS 2U |
123 | | -#define RESET_CONTROL_SERIAL_COMMAND 3U |
124 | | - |
125 | | -#define OPEN_LOOP_BOOST 0U |
126 | | -#define CLOSED_LOOP_BOOST 1U |
127 | | - |
128 | | -#define SOFT_LIMIT_FIXED 0U |
129 | | -#define SOFT_LIMIT_RELATIVE 1U |
130 | | - |
131 | | -#define VVT_MODE_ONOFF 0U |
132 | | -#define VVT_MODE_OPEN_LOOP 1U |
133 | | -#define VVT_MODE_CLOSED_LOOP 2U |
134 | | - |
135 | | -#define VVT_LOAD_MAP 0U |
136 | | -#define VVT_LOAD_TPS 1U |
137 | | - |
138 | | -#define MULTIPLY_MAP_MODE_OFF 0U |
139 | | -#define MULTIPLY_MAP_MODE_BARO 1U |
140 | | -#define MULTIPLY_MAP_MODE_100 2U |
141 | | - |
142 | | -#define FOUR_STROKE 0U |
143 | | -#define TWO_STROKE 1U |
144 | | - |
145 | | -#define GOING_LOW 0U |
146 | | -#define GOING_HIGH 1U |
147 | | - |
148 | | -#define BATTV_COR_MODE_WHOLE 0U |
149 | | -#define BATTV_COR_MODE_OPENTIME 1U |
| 148 | +constexpr uint8_t IAC_ALGORITHM_NONE = 0U; |
| 149 | +constexpr uint8_t IAC_ALGORITHM_ONOFF = 1U; |
| 150 | +constexpr uint8_t IAC_ALGORITHM_PWM_OL = 2U; |
| 151 | +constexpr uint8_t IAC_ALGORITHM_PWM_CL = 3U; |
| 152 | +constexpr uint8_t IAC_ALGORITHM_STEP_OL = 4U; |
| 153 | +constexpr uint8_t IAC_ALGORITHM_STEP_CL = 5U; |
| 154 | +constexpr uint8_t IAC_ALGORITHM_PWM_OLCL = 6U; //Openloop plus closedloop IAC control |
| 155 | +constexpr uint8_t IAC_ALGORITHM_STEP_OLCL = 7U; //Openloop plus closedloop IAC control |
150 | 156 |
|
151 | 157 | enum MAPSamplingMethod { |
152 | 158 | MAPSamplingInstantaneous = 0, |
@@ -328,12 +334,12 @@ struct config2 { |
328 | 334 | } __attribute__((packed,aligned(__alignof__(uint16_t)))); //The 32 bit systems require all structs to be fully packed, aligned to their largest member type |
329 | 335 | #endif |
330 | 336 |
|
331 | | -#define IDLEADVANCE_MODE_OFF 0U |
332 | | -#define IDLEADVANCE_MODE_ADDED 1U |
333 | | -#define IDLEADVANCE_MODE_SWITCHED 2U |
| 337 | +constexpr uint8_t IDLEADVANCE_MODE_OFF = 0U; |
| 338 | +constexpr uint8_t IDLEADVANCE_MODE_ADDED = 1U; |
| 339 | +constexpr uint8_t IDLEADVANCE_MODE_SWITCHED = 2U; |
334 | 340 |
|
335 | | -#define IDLEADVANCE_ALGO_TPS 0U |
336 | | -#define IDLEADVANCE_ALGO_CTPS 1U |
| 341 | +constexpr uint8_t IDLEADVANCE_ALGO_TPS = 0U; |
| 342 | +constexpr uint8_t IDLEADVANCE_ALGO_CTPS = 1U; |
337 | 343 |
|
338 | 344 | /** Page 4 of the config - variables required for ignition and rpm/crank phase /cam phase decoding. |
339 | 345 | * See the ini file for further reference. |
|
0 commit comments