support 1-3-2 firing order (#1537)

* support 1-3-2

* oops

* correct TS

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2020-06-26 06:07:43 -07:00 committed by GitHub
parent 9730080873
commit cddb469678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -19,6 +19,7 @@ typedef enum {
// 3 cylinder
FO_1_2_3 = 10,
FO_1_3_2 = 24,
// 4 cylinder
FO_1_3_4_2 = 1, // typical inline 4
@ -62,7 +63,7 @@ typedef enum {
// unfortunately not supported by default firmware because INJECTION_PIN_COUNT=IGNITION_PIN_COUNT=12 by default
FO_1_14_9_4_7_12_15_6_13_8_3_16_11_2_5_10 = 22, // WR16
// max used = 23
// max used = 24
Force_4b_firing_order = ENUM_32_BITS,
} firing_order_e;

View File

@ -269,6 +269,7 @@ floatms_t getSparkDwell(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
static const int order_1_2[] = {1, 2};
static const int order_1_2_3[] = {1, 2, 3};
static const int order_1_3_2[] = {1, 3, 2};
// 4 cylinder
static const int order_1_THEN_3_THEN_4_THEN2[] = { 1, 3, 4, 2 };
@ -317,6 +318,7 @@ static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
return 2;
// 3 cylinder
case FO_1_2_3:
case FO_1_3_2:
return 3;
// 4 cylinder
case FO_1_3_4_2:
@ -401,6 +403,8 @@ int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) {
// 3 cylinder
case FO_1_2_3:
return order_1_2_3[index];
case FO_1_3_2:
return order_1_3_2[index];
// 4 cylinder
case FO_1_3_4_2:
return order_1_THEN_3_THEN_4_THEN2[index];

View File

@ -451,7 +451,7 @@ cylinders_count_t cylindersCount;
! FO_1_8_4_3_6_5_7_2 = 5
! FO_1_2_4_5_3 = 6
custom firing_order_e 4 bits, U32, @OFFSET@, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "1-12-5-8-3-10-6-7-2-11-4-9", "1-2-7-8-4-5-6-3", "1-3-7-2-6-5-4-8", "1-2-3-4-5-6-7-8-9", "fo22", "fo23", "fo24", "fo25", "INVALID"
custom firing_order_e 4 bits, U32, @OFFSET@, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "1-12-5-8-3-10-6-7-2-11-4-9", "1-2-7-8-4-5-6-3", "1-3-7-2-6-5-4-8", "1-2-3-4-5-6-7-8-9", "INVALID", "1-2-3-4-5-6-7-8-9-10-11-12", "1-3-2", "INVALID", "INVALID"
firing_order_e firingOrder;
end_struct