From a8afb6eb85b6016aa16f0b5dfb16e4a84a054c8b Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 21 Jul 2021 19:55:14 -0400 Subject: [PATCH] trailing spark outputs #2931 --- firmware/config/engines/custom_engine.cpp | 22 +++++++++++++++++++ firmware/config/engines/custom_engine.h | 1 + .../algo/auto_generated_commonenum.cpp | 4 +++- .../controllers/algo/engine_configuration.cpp | 3 +++ firmware/controllers/algo/rusefi_enums.h | 2 ++ 5 files changed, 31 insertions(+), 1 deletion(-) diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index a9d40a3b9d..5e353a28da 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -689,6 +689,28 @@ void setBoschHDEV_5_injectors(DECLARE_CONFIG_PARAMETER_SIGNATURE) { CONFIG(mc33_t_hold_tot) = 10000; } +/** + * set engine_type 107 + */ +void setRotary(DECLARE_CONFIG_PARAMETER_SIGNATURE) { + engineConfiguration->specs.cylindersCount = 2; + engineConfiguration->specs.firingOrder = FO_1_2; + + engineConfiguration->trigger.type = TT_36_2_2_2; + setOperationMode(engineConfiguration, TWO_STROKE); + + strcpy(CONFIG(engineMake), ENGINE_MAKE_MAZDA); + strcpy(CONFIG(engineCode), "13B"); + strcpy(CONFIG(vehicleName), "test"); + + engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; + engineConfiguration->injectionPins[2] = GPIO_UNASSIGNED; // injector in default pinout + engineConfiguration->injectionPins[3] = GPIO_UNASSIGNED; + + engineConfiguration->enableTrailingSparks = true; + engineConfiguration->trailingCoilPins[0] = GPIOC_9; + engineConfiguration->trailingCoilPins[1] = GPIOE_10; +} /** * set engine_type 103 diff --git a/firmware/config/engines/custom_engine.h b/firmware/config/engines/custom_engine.h index a9a34e9f52..bfd2393fab 100644 --- a/firmware/config/engines/custom_engine.h +++ b/firmware/config/engines/custom_engine.h @@ -33,3 +33,4 @@ void proteusBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setTest33816EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setBoschHDEV_5_injectors(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setHellen72etb(DECLARE_CONFIG_PARAMETER_SIGNATURE); +void setRotary(DECLARE_CONFIG_PARAMETER_SIGNATURE); diff --git a/firmware/controllers/algo/auto_generated_commonenum.cpp b/firmware/controllers/algo/auto_generated_commonenum.cpp index 71db5020e7..ef68b742e4 100644 --- a/firmware/controllers/algo/auto_generated_commonenum.cpp +++ b/firmware/controllers/algo/auto_generated_commonenum.cpp @@ -1,6 +1,6 @@ #include "global.h" #include "rusefi_enums.h" -// was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Sat Jul 17 00:25:01 EDT 2021 +// was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Wed Jul 21 19:45:59 EDT 2021 // see also gen_config_and_enums.bat @@ -536,6 +536,8 @@ case TEST_ISSUE_366_RISE: return "TEST_ISSUE_366_RISE"; case TEST_ISSUE_898: return "TEST_ISSUE_898"; +case TEST_ROTARY: + return "TEST_ROTARY"; case TLE8888_BENCH_ENGINE: return "TLE8888_BENCH_ENGINE"; case TOYOTA_2JZ_GTE_VVTi: diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index fd20b9a489..9bc2222acb 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -1104,6 +1104,9 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e case TEST_33816: setTest33816EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE); break; + case TEST_ROTARY: + setRotary(PASS_CONFIG_PARAMETER_SIGNATURE); + break; #endif // HW_FRANKENSO #ifdef HW_SUBARU_EG33 case SUBARUEG33_DEFAULTS: diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index c91a49ab4c..005b4efd9f 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -220,6 +220,8 @@ typedef enum { BMW_M73_MRE = 104, BMW_M73_MRE_SLAVE = 105, + TEST_ROTARY = ET_TEST_ROTARY, + Force_4_bytes_size_engine_type = ENUM_32_BITS, } engine_type_e;