rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
firing_order.h
Go to the documentation of this file.
1/*
2 * @file firing_order.h
3 *
4 * See also FiringOrderTSLogic.java
5 *
6 * @date Jul 20, 2016
7 * @author Andrey Belomutskiy, (c) 2012-2020
8 */
9
10#pragma once
11
12#include "rusefi_enums.h"
13
14/**
15 * thank you https://www.ingenieriaymecanicaautomotriz.com/firing-order-its-purpose-and-order-in-different-numbers-of-cylinders/
16 */
17typedef enum __attribute__ ((__packed__)) {
18 FO_1 = 0,
19
20 // 2 cylinder
21 FO_1_2 = 8,
22
23 // 3 cylinder
24 FO_1_2_3 = 10,
25 FO_1_3_2 = 24,
26
27 // 4 cylinder
28 FO_1_3_4_2 = 1, // typical inline 4
29 FO_1_2_4_3 = 2,
30 FO_1_3_2_4 = 3, // for example horizontally opposed engine
31 FO_1_4_3_2 = 17, // for example VW aircooled boxer engine
32
33 // 5 cylinder
34 FO_1_2_4_5_3 = 6,
35
36 // 6 cylinder
37 FO_1_5_3_6_2_4 = 4, // VAG VR6, Straight-6, Opel Omega A
38 FO_1_6_5_4_3_2 = 30, // GM 3800 engine
39 FO_1_4_5_2_3_6 = 31, // Chevrolet Corvair
40 FO_1_4_2_5_3_6 = 7, // Mercedes-Benz M104 engine
41 FO_1_2_3_4_5_6 = 9, // all Nissan v6, GM 60-Degree V6 engine
42 FO_1_6_3_2_5_4 = 13, // EG33
43 FO_1_4_3_6_2_5 = 27, // VAG v6 different from VAG VR6
44 FO_1_6_2_4_3_5 = 29, // Some 911
45
46
47 // todo: one day we shall support 7 cylinder radial, probably not before one actually approaches us
48 // 1-3-5-7-2-4-6 7-cylinder single row radial engine
49
50 // 8 cylinder
51 FO_1_8_4_3_6_5_7_2 = 5, // SBC, Dodge
52 FO_1_8_7_2_6_5_4_3 = 11, // GM Gen. 3, 4, 5 LT1
53 FO_1_5_4_2_6_3_7_8 = 12, // Ford Mustang
54 FO_1_2_7_8_4_5_6_3 = 19,
55 FO_1_3_7_2_6_5_4_8 = 20, // Ford 5.0 HO and 351W
56 FO_1_2_3_4_5_6_7_8 = 25, // linearly incrementing, for V8 testing
57 FO_1_5_4_8_6_3_7_2 = 26, // Audi 4.2 40v V8
58 FO_1_5_4_8_3_7_2_6 = 32, // Ford Voodoo
59 FO_1_8_7_3_6_5_4_2 = 28, // VH41DE (Japaneese Y32 Variant)
60 FO_1_8_6_2_7_3_4_5 = 34, // Ferrari-Maserati F136
61
62 // 9 cylinder - for instance radial :)
63 // PS: Matt says that 9cyl is actually 1-3-5-7-9-2-4-6-8 or 1-8-6-4-2-9-7-5-3 for reverse rotation
64 FO_1_2_3_4_5_6_7_8_9 = 21,
65
66 // 10 cylinder
67 FO_1_10_9_4_3_6_5_8_7_2 = 14, // dodge and viper ram v10
68 FO_1_6_5_10_2_7_3_8_4_9 = 33, // BMW S85, also Audi 5.2 R8 and huracan GDI
69
70 // 12 cylinder
71 FO_1_7_5_11_3_9_6_12_2_8_4_10 = 15, // bmw M70 & M73, Ferrari 456M GT V12
72 FO_1_7_4_10_2_8_6_12_3_9_5_11 = 16, // Lamborghini Diablo VT, typical rusEfi use-case
73 FO_1_12_5_8_3_10_6_7_2_11_4_9 = 18, // VAG W12, M120
74 // 1,12,7,6,3,10,11,2,5,8,9,4 Rolls-Royce Merlin
75 // 1,12,4,9,2,11,6,7,3,10,5,8 Lamborghini Aventador
76 FO_1_2_3_4_5_6_7_8_9_10_11_12 = 23, // mostly for hardware testing purposes
77
78
79 // 16 cylinder
80 // unfortunately not supported by default firmware because MAX_CYLINDER_COUNT=12 by default
81 FO_1_14_9_4_7_12_15_6_13_8_3_16_11_2_5_10 = 22, // WR16
82
83 // next value to use: 35
84
86
87/**
88 * @param cylinderIndex Queried position in the firing order. 0 means the first cylinder to fire, 1 means second, etc. Maximum cylinderCount - 1.
89 * @return The cylinder number in the requested position, from 0 to cylindersCount - 1.
90 * For example, getCylinderNumberAtIndex(2) means the 3rd cylinder to fire, and on a 1342 4-cyl will return 3, indicating cylinder 4.
91 */
92size_t getCylinderNumberAtIndex(size_t cylinderIndex);
typedef __attribute__
Ignition Mode.
firing_order_e
size_t getCylinderNumberAtIndex(size_t cylinderIndex)
Fundamental rusEFI enumerable types live here.