Core/Inc/engine_config.h is the primary engine-adaptation file. It centralises the items that change per engine: cylinder count, firing order, channel assignment, dwell limit, boost timing and injector-comparator thresholds.
Included reference configuration
The repository defines an inline-four example with firing order 1-3-4-2 and 180 degree spacing. It is not a default for every engine. Do not copy its firing order, dwell limit, timing angles or injection assumptions into another build.
Configuration elements
| Element | Purpose |
|---|---|
CYLINDER_COUNT |
Number of active cylinders represented by the firing table. |
firing_order[] |
Physical cylinder ID, spacing in the 720 degree cycle, ignition channel and injector channel. |
ign_hw[] |
Maps ignition channel numbers to MCU GPIO outputs. |
inj_hw[] |
Maps injector channels to comparator, DAC, selection and boost resources. |
| Dwell and boost settings | Hardware and load-dependent values requiring independent validation. |
Recommended change method
- Write the cylinder numbering and firing order for the target engine.
- Define the 0 to 720 degree convention and TDC reference.
- Map every coil and injector to the actual harness and board channel.
- Change one configuration dimension at a time, build, then test with passive loads.
- Review every channel after each change.
Suggested screenshot: annotated engine_config.h firing-order table after the configuration-elements table.