Add firing order fix #1385

This commit is contained in:
rusefi 2020-04-29 16:46:59 -04:00
parent 59600c48b5
commit 9180154848
10 changed files with 34 additions and 15 deletions

View File

@ -40,6 +40,10 @@ typedef enum {
FO_1_8_7_2_6_5_4_3 = 11,
FO_1_5_4_2_6_3_7_8 = 12,
FO_1_2_7_8_4_5_6_3 = 19,
FO_1_3_7_2_6_5_4_8 = 20, // Ford 5.0 HO and 351W
// 9 cylinder - for instance radial :)
FO_1_2_3_4_5_6_7_8_9 = 21,
// 10 cylinder
FO_1_10_9_4_3_6_5_8_7_2 = 14, // dodge and viper ram v10
@ -52,7 +56,7 @@ typedef enum {
// 16 cylinder
// todo: 1-14-9-4-7-12-15-6-13-8-3-16-11-2-5-10
// max used = 19
// max used = 21
Force_4b_firing_order = ENUM_32_BITS,
} firing_order_e;

View File

@ -753,6 +753,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20200426;
return 20200429;
}
#endif /* EFI_UNIT_TEST */

View File

@ -293,6 +293,10 @@ static const int order_1_8_4_3_6_5_7_2[] = { 1, 8, 4, 3, 6, 5, 7, 2 };
static const int order_1_8_7_2_6_5_4_3[] = { 1, 8, 7, 2, 6, 5, 4, 3 };
static const int order_1_5_4_2_6_3_7_8[] = { 1, 5, 4, 2, 6, 3, 7, 8 };
static const int order_1_2_7_8_4_5_6_3[] = { 1, 2, 7, 8, 4, 5, 6, 3 };
static const int order_1_3_7_2_6_5_4_8[] = { 1, 3, 7, 2, 6, 5, 4, 8 };
// 9 cylinder
static const int order_1_2_3_4_5_6_7_8_9[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
// 10 cylinder
static const int order_1_10_9_4_3_6_5_8_7_2[] = {1, 10, 9, 4, 3, 6, 5, 8, 7, 2};
@ -335,8 +339,13 @@ static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
case FO_1_8_7_2_6_5_4_3:
case FO_1_5_4_2_6_3_7_8:
case FO_1_2_7_8_4_5_6_3:
case FO_1_3_7_2_6_5_4_8:
return 8;
// 9 cylinder radial
case FO_1_2_3_4_5_6_7_8_9:
return 9;
// 10 cylinder
case FO_1_10_9_4_3_6_5_8_7_2:
return 10;
@ -418,6 +427,12 @@ int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) {
return order_1_5_4_2_6_3_7_8[index];
case FO_1_2_7_8_4_5_6_3:
return order_1_2_7_8_4_5_6_3[index];
case FO_1_3_7_2_6_5_4_8:
return order_1_3_7_2_6_5_4_8[index];
case FO_1_2_3_4_5_6_7_8_9:
return order_1_2_3_4_5_6_7_8_9[index];
// 10 cylinder
case FO_1_10_9_4_3_6_5_8_7_2:

View File

@ -450,7 +450,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:7], "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", "fo20", "fo21", "fo22", "INVALID"
custom firing_order_e 4 bits, U32, @OFFSET@, [0:7], "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"
firing_order_e firingOrder;
end_struct

View File

@ -89,7 +89,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Tue Apr 28 20:10:00 EDT 2020
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 29 16:41:28 EDT 2020
pageSize = 20000
page = 1
@ -175,7 +175,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:7], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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", "fo20", "fo21", "fo22", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2

View File

@ -89,7 +89,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Tue Apr 28 20:10:05 EDT 2020
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 29 16:41:33 EDT 2020
pageSize = 20000
page = 1
@ -175,7 +175,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:7], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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", "fo20", "fo21", "fo22", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2

View File

@ -89,7 +89,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Tue Apr 28 20:11:11 EDT 2020
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Wed Apr 29 16:41:41 EDT 2020
pageSize = 20000
page = 1
@ -175,7 +175,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:7], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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", "fo20", "fo21", "fo22", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2

View File

@ -89,7 +89,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Tue Apr 28 20:10:03 EDT 2020
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 29 16:41:31 EDT 2020
pageSize = 20000
page = 1
@ -175,7 +175,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:7], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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", "fo20", "fo21", "fo22", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2

View File

@ -89,7 +89,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Tue Apr 28 20:10:29 EDT 2020
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 29 16:41:35 EDT 2020
pageSize = 20000
page = 1
@ -175,7 +175,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:7], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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", "fo20", "fo21", "fo22", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2

View File

@ -89,7 +89,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Tue Apr 28 20:10:49 EDT 2020
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed Apr 29 16:41:38 EDT 2020
pageSize = 20000
page = 1
@ -175,7 +175,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:7], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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", "fo20", "fo21", "fo22", "INVALID"
firingOrder = bits, U32, 404, [0:7], "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"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2