diff --git a/firmware/controllers/algo/firing_order.h b/firmware/controllers/algo/firing_order.h index 11b7510cf4..d84e4d7f5c 100644 --- a/firmware/controllers/algo/firing_order.h +++ b/firmware/controllers/algo/firing_order.h @@ -39,6 +39,7 @@ typedef enum { FO_1_8_4_3_6_5_7_2 = 5, 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, // 10 cylinder FO_1_10_9_4_3_6_5_8_7_2 = 14, // dodge and viper ram v10 @@ -48,7 +49,7 @@ typedef enum { FO_1_7_4_10_2_8_6_12_3_9_5_11 = 16, // lamborghini, typical rusEfi use-case FO_1_12_5_8_3_10_6_7_2_11_4_9 = 18, // VAG W12 - // max used = 18 + // max used = 19 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 03db8ff76b..b37cddec34 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -832,6 +832,6 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20190927; + return 20190928; } #endif /* EFI_UNIT_TEST */ diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index 457b46d63e..8a4d4795dc 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -289,9 +289,9 @@ static const int order_1_6_3_2_5_4[] = {1, 6, 3, 2, 5, 4}; // 8 cylinder 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 }; // 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}; @@ -333,6 +333,7 @@ static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_SIGNATURE) { case FO_1_8_4_3_6_5_7_2: 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: return 8; // 10 cylinder @@ -414,6 +415,8 @@ int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) { return order_1_8_7_2_6_5_4_3[index]; case FO_1_5_4_2_6_3_7_8: 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]; // 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 39ef4bb296..54bf3dfc46 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -353,7 +353,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", "fo18", "fo19", "fo20", "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", "fo20", "fo21", "fo22", "INVALID" firing_order_e firingOrder; end_struct diff --git a/java_console/models/src/com/rusefi/FiringOrderTSLogic.java b/java_console/models/src/com/rusefi/FiringOrderTSLogic.java index 53aeaf92bc..05693ba11b 100644 --- a/java_console/models/src/com/rusefi/FiringOrderTSLogic.java +++ b/java_console/models/src/com/rusefi/FiringOrderTSLogic.java @@ -35,19 +35,24 @@ public class FiringOrderTSLogic { continue; } line = line.substring(index + FIRING_ORDER_PREFIX.length()); - line = line.replaceAll("[\\s\\,]", ""); - System.out.println("Processing " + line); - - String s[] = line.split("\\="); - String order[] = s[0].split("_"); - int ordinal = Integer.parseInt(s[1]); - - System.out.println("order " + Arrays.toString(order) + ": " + ordinal); - - ordinal2order.put(ordinal, order); + parseLine(line); } } + public static void parseLine(String line) { + line = line.replaceAll("[\\s]*\\,.*", ""); + line = line.replaceAll("[\\s\\,]", ""); + System.out.println("Processing " + line); + + String s[] = line.split("\\="); + String order[] = s[0].split("_"); + int ordinal = Integer.parseInt(s[1]); + + System.out.println("order " + Arrays.toString(order) + ": " + ordinal); + + ordinal2order.put(ordinal, order); + } + private static void processId(int cylinderId) { StringBuilder logic = new StringBuilder(); diff --git a/java_console/models/src/com/rusefi/test/FiringOrderTSLogicTest.java b/java_console/models/src/com/rusefi/test/FiringOrderTSLogicTest.java new file mode 100644 index 0000000000..5c9247fca4 --- /dev/null +++ b/java_console/models/src/com/rusefi/test/FiringOrderTSLogicTest.java @@ -0,0 +1,11 @@ +package com.rusefi.test; + +import com.rusefi.FiringOrderTSLogic; +import org.junit.Test; + +public class FiringOrderTSLogicTest { + @Test + public void parseFiringOrderLine() { + FiringOrderTSLogic.parseLine("FO_1_3_4_2 = 1, // typical inline 4"); + } +}