From 67e1f06d36e6da3c14d01af784cbe758d99f2904 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 23 Dec 2019 22:50:04 -0500 Subject: [PATCH] simplicity? --- firmware/controllers/engine_controller.cpp | 17 ++++++++--------- simulator/simulator/rusEfiFunctionalTest.cpp | 2 -- unit_tests/engine_test_helper.cpp | 1 - 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 8ec8d8f14f..653ac31876 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -695,6 +695,14 @@ void commonInitEngineController(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S #endif mostCommonInitEngineController(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); + +#if EFI_SHAFT_POSITION_INPUT + /** + * there is an implicit dependency on the fact that 'tachometer' listener is the 1st listener - this case + * other listeners can access current RPM value + */ + initRpmCalculator(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); +#endif /* EFI_SHAFT_POSITION_INPUT */ } #if !EFI_UNIT_TEST @@ -723,15 +731,6 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) initCJ125(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); #endif /* EFI_CJ125 */ - -#if EFI_SHAFT_POSITION_INPUT - /** - * there is an implicit dependency on the fact that 'tachometer' listener is the 1st listener - this case - * other listeners can access current RPM value - */ - initRpmCalculator(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); -#endif /* EFI_SHAFT_POSITION_INPUT */ - #if EFI_PROD_CODE && EFI_ENGINE_CONTROL initInjectorCentral(sharedLogger); #endif /* EFI_PROD_CODE && EFI_ENGINE_CONTROL */ diff --git a/simulator/simulator/rusEfiFunctionalTest.cpp b/simulator/simulator/rusEfiFunctionalTest.cpp index 3e25884cd0..5b060058b7 100644 --- a/simulator/simulator/rusEfiFunctionalTest.cpp +++ b/simulator/simulator/rusEfiFunctionalTest.cpp @@ -123,8 +123,6 @@ void rusEfiFunctionalTest(void) { commonInitEngineController(&sharedLogger); - initRpmCalculator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); - initTriggerCentral(&sharedLogger); initTriggerEmulator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); diff --git a/unit_tests/engine_test_helper.cpp b/unit_tests/engine_test_helper.cpp index 6bf295cc19..e3e4e11424 100644 --- a/unit_tests/engine_test_helper.cpp +++ b/unit_tests/engine_test_helper.cpp @@ -75,7 +75,6 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb engine->periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); engine->initializeTriggerWaveform(NULL PASS_ENGINE_PARAMETER_SUFFIX); - initRpmCalculator(NULL PASS_ENGINE_PARAMETER_SUFFIX); initMainEventListener(NULL PASS_ENGINE_PARAMETER_SUFFIX); }