diff --git a/firmware/controllers/algo/firing_order.h b/firmware/controllers/algo/firing_order.h index 5441f5abb4..9bed06331b 100644 --- a/firmware/controllers/algo/firing_order.h +++ b/firmware/controllers/algo/firing_order.h @@ -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; diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 1704599af8..543b02f131 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -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 */ diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index 74a431f87d..d9c00784d9 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -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: diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index bcd0f2fa17..649df5e309 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -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