From 4a21efcb695d3da06464d85f15ca47746fc7bf7b Mon Sep 17 00:00:00 2001 From: rusEfi Date: Wed, 8 Feb 2017 01:03:36 -0500 Subject: [PATCH] auto-sync --- .../controllers/algo/auto_generated_enums.cpp | 2 ++ firmware/controllers/algo/firing_order.h | 18 +++++++++++---- firmware/controllers/math/engine_math.cpp | 22 +++++++++++++++++-- firmware/integration/rusefi_config.txt | 2 +- firmware/tunerstudio/rusefi.ini | 4 ++-- 5 files changed, 39 insertions(+), 9 deletions(-) diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index fe67b62be2..82c7e90b66 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -390,6 +390,8 @@ case FO_1_8_7_2_6_5_4_3: return "FO_1_8_7_2_6_5_4_3"; case FO_1_5_4_2_6_3_7_8: return "FO_1_5_4_2_6_3_7_8"; +case FO_1_10_9_4_3_6_5_8_7_2: + return "FO_1_10_9_4_3_6_5_8_7_2"; case Force_4b_firing_order: return "Force_4b_firing_order"; } diff --git a/firmware/controllers/algo/firing_order.h b/firmware/controllers/algo/firing_order.h index 628ab33a91..d0610d03a7 100644 --- a/firmware/controllers/algo/firing_order.h +++ b/firmware/controllers/algo/firing_order.h @@ -25,10 +25,7 @@ typedef enum { FO_1_3_4_2 = 1, // typical inline 4 FO_1_2_4_3 = 2, FO_1_3_2_4 = 3, // for example horizontally opposed engine - // 8 cylinder - 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, + // 5 cylinder FO_1_2_4_5_3 = 6, @@ -38,6 +35,19 @@ typedef enum { FO_1_2_3_4_5_6 = 9, FO_1_6_3_2_5_4 = 13, // EG33 + // 8 cylinder + 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, + + // 10 cylinder + FO_1_10_9_4_3_6_5_8_7_2 = 14, // dodge and viper ram v10 + + // 12 cylinder + FO_1_7_5_11_3_9_6_12_2_8_4_10 = 15, // bmw M70 etc + + // max used = 15 + Force_4b_firing_order = ENUM_32_BITS, } firing_order_e; diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index eae83e4db5..b800bfc91f 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -280,25 +280,35 @@ void TriggerShape::findTriggerPosition(event_trigger_position_s *position, angle position->angleOffset = angleOffset - eventAngle; } +static int order_1_2[] = {1, 2}; + +static int order_1_2_3[] = {1, 2, 3}; +// 4 cylinder + static int order_1_THEN_3_THEN_4_THEN2[] = { 1, 3, 4, 2 }; static int order_1_THEN_2_THEN_4_THEN3[] = { 1, 2, 4, 3 }; static int order_1_THEN_3_THEN_2_THEN4[] = { 1, 3, 2, 4 }; +// 5 cylinder static int order_1_2_4_5_3[] = {1, 2, 4, 5, 3}; +// 6 cylinder static int order_1_THEN_5_THEN_3_THEN_6_THEN_2_THEN_4[] = { 1, 5, 3, 6, 2, 4 }; static int order_1_THEN_4_THEN_2_THEN_5_THEN_3_THEN_6[] = { 1, 4, 2, 5, 3, 6 }; static int order_1_THEN_2_THEN_3_THEN_4_THEN_5_THEN_6[] = { 1, 2, 3, 4, 5, 6 }; static int order_1_6_3_2_5_4[] = {1, 6, 3, 2, 5, 4}; +// 8 cylinder static int order_1_8_4_3_6_5_7_2[] = { 1, 8, 4, 3, 6, 5, 7, 2 }; static int order_1_8_7_2_6_5_4_3[] = { 1, 8, 7, 2, 6, 5, 4, 3 }; static int order_1_5_4_2_6_3_7_8[] = { 1, 5, 4, 2, 6, 3, 7, 8 }; -static int order_1_2[] = {1, 2}; +// 10 cylinder +static int order_1_10_9_4_3_6_5_8_7_2[] = {1, 10, 9, 4, 3, 6, 5, 8, 7, 2}; -static int order_1_2_3[] = {1, 2, 3}; +// 12 cyliner +static int order_1_7_5_11_3_9_6_12_2_8_4_10[] = {1, 7, 5, 11, 3, 9, 6, 12, 2, 8, 4, 10}; /** * @param index from zero to cylindersCount - 1 @@ -344,6 +354,14 @@ int getCylinderId(firing_order_e firingOrder, int index) { case FO_1_5_4_2_6_3_7_8: return order_1_5_4_2_6_3_7_8[index]; +// 10 cylinder + case FO_1_10_9_4_3_6_5_8_7_2: + return order_1_10_9_4_3_6_5_8_7_2[index]; + +// 12 cylinder + case FO_1_7_5_11_3_9_6_12_2_8_4_10: + return order_1_7_5_11_3_9_6_12_2_8_4_10[index]; + default: warning(CUSTOM_OBD_23, "getCylinderId not supported for %d", firingOrder); } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 0e2b96c354..b7f83e23ae 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -259,7 +259,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:3], "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", "fo14", "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", "fo16", "fo17", "INVALID" firing_order_e firingOrder; end_struct diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 4536b8f9e9..c4d938b8d8 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -42,7 +42,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Feb 06 20:36:08 EST 2017 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Wed Feb 08 00:14:53 EST 2017 pageSize = 16376 page = 1 @@ -123,7 +123,7 @@ page = 1 sparkDwell = array, F32, 368, [8], "ms", 1, 0.0, 0.0, 30.0, 2 displacement = scalar, F32, 400, "L", 1, 0, 0, 1000.0, 2 cylindersCount = bits, U32, 404, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID" - firingOrder = bits, U32, 408, [0:3], "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", "fo14", "INVALID" + firingOrder = bits, U32, 408, [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", "fo16", "fo17", "INVALID" cylinderBore = scalar, F32, 412, "mm", 1, 0, 0, 20000.0, 2 sensorSnifferRpmThreshold = scalar, S32, 416, "RPM", 1, 0, 0,30000, 0 rpmHardLimit = scalar, S32, 420, "rpm", 1, 0, 0, 20000.0, 2