diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 0ca21b36c0..a0e506b212 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -661,7 +661,7 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) * 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, engine); + initRpmCalculator(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); #endif /* EFI_SHAFT_POSITION_INPUT */ #if (EFI_PROD_CODE && EFI_ENGINE_CONTROL) || defined(__DOXYGEN__) diff --git a/firmware/controllers/trigger/aux_valves.cpp b/firmware/controllers/trigger/aux_valves.cpp index fc80655ad8..f626bdfbef 100644 --- a/firmware/controllers/trigger/aux_valves.cpp +++ b/firmware/controllers/trigger/aux_valves.cpp @@ -13,10 +13,10 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ +#include "engine_math.h" #include "aux_valves.h" #include "allsensors.h" #include "trigger_central.h" -#include "engine_math.h" EXTERN_ENGINE ; diff --git a/firmware/controllers/trigger/decoders/trigger_structure.cpp b/firmware/controllers/trigger/decoders/trigger_structure.cpp index e0a7d71186..e7c7ad8ae5 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.cpp +++ b/firmware/controllers/trigger/decoders/trigger_structure.cpp @@ -20,6 +20,7 @@ #include "global.h" +#include "engine.h" #include "trigger_bmw.h" #include "trigger_chrysler.h" #include "trigger_gm.h" diff --git a/firmware/controllers/trigger/decoders/trigger_toyota.cpp b/firmware/controllers/trigger/decoders/trigger_toyota.cpp index 8242cd1c02..630d03b841 100644 --- a/firmware/controllers/trigger/decoders/trigger_toyota.cpp +++ b/firmware/controllers/trigger/decoders/trigger_toyota.cpp @@ -9,8 +9,6 @@ #include "trigger_toyota.h" -EXTERN_ENGINE; - void initialize2jzGE1_12(TriggerShape *s) { s->initialize(FOUR_STROKE_CAM_SENSOR, true); diff --git a/firmware/controllers/trigger/decoders/trigger_toyota.h b/firmware/controllers/trigger/decoders/trigger_toyota.h index 4b55d35f5d..8b29734398 100644 --- a/firmware/controllers/trigger/decoders/trigger_toyota.h +++ b/firmware/controllers/trigger/decoders/trigger_toyota.h @@ -8,7 +8,7 @@ #ifndef CONTROLLERS_TRIGGER_TRIGGER_TOYOTA_H_ #define CONTROLLERS_TRIGGER_TRIGGER_TOYOTA_H_ -#include "engine.h" +#include "trigger_structure.h" void initialize2jzGE1_12(TriggerShape *s); void initialize2jzGE3_34(TriggerShape *s); diff --git a/firmware/controllers/trigger/rpm_calculator.cpp b/firmware/controllers/trigger/rpm_calculator.cpp index ae6da75ca4..fbc62ea5be 100644 --- a/firmware/controllers/trigger/rpm_calculator.cpp +++ b/firmware/controllers/trigger/rpm_calculator.cpp @@ -10,8 +10,8 @@ * @author Andrey Belomutskiy, (c) 2012-2018 */ -#include "global.h" #include "rpm_calculator.h" +#include "engine.h" #if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) @@ -344,7 +344,7 @@ float getCrankshaftAngleNt(efitime_t timeNt DECLARE_ENGINE_PARAMETER_SUFFIX) { return rpm == 0 ? NAN : timeSinceZeroAngleNt / getOneDegreeTimeNt(rpm); } -void initRpmCalculator(Logging *sharedLogger, Engine *engine) { +void initRpmCalculator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { logger = sharedLogger; if (hasFirmwareError()) { return; diff --git a/firmware/controllers/trigger/rpm_calculator.h b/firmware/controllers/trigger/rpm_calculator.h index 38179ab12e..8c2f20e89a 100644 --- a/firmware/controllers/trigger/rpm_calculator.h +++ b/firmware/controllers/trigger/rpm_calculator.h @@ -10,7 +10,6 @@ #define RPM_REPORTER_H_ #include -#include "engine_configuration.h" #include "scheduler.h" #define TOP_DEAD_CENTER_MESSAGE "r" @@ -34,8 +33,6 @@ #define RPM_LOW_THRESHOLD 25 #endif -#ifdef __cplusplus - typedef enum { /** * The engine is not spinning, RPM=0 @@ -56,8 +53,6 @@ typedef enum { RUNNING, } spinning_state_e; -class Engine; - #define GET_RPM() ( ENGINE(rpmCalculator.rpmValue) ) class RpmCalculator { @@ -166,11 +161,9 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, uint32_t index DECL /** * @brief Initialize RPM calculator */ -void initRpmCalculator(Logging *sharedLogger, Engine *engine); +void initRpmCalculator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX); float getCrankshaftAngleNt(efitime_t timeNt DECLARE_ENGINE_PARAMETER_SUFFIX); -#endif - int getRevolutionCounter(void); diff --git a/firmware/controllers/trigger/trigger_emulator_algo.cpp b/firmware/controllers/trigger/trigger_emulator_algo.cpp index 5790b4fc1f..9104fc5f6a 100644 --- a/firmware/controllers/trigger/trigger_emulator_algo.cpp +++ b/firmware/controllers/trigger/trigger_emulator_algo.cpp @@ -17,6 +17,7 @@ #if EFI_EMULATE_POSITION_SENSORS || defined(__DOXYGEN__) +#include "engine.h" #include "trigger_emulator_algo.h" #include "engine_configuration.h" #include "trigger_central.h" diff --git a/firmware/development/hw_layer/poten.cpp b/firmware/development/hw_layer/poten.cpp index 817f65e55d..94b4cab4c1 100644 --- a/firmware/development/hw_layer/poten.cpp +++ b/firmware/development/hw_layer/poten.cpp @@ -11,6 +11,7 @@ #include "eficonsole.h" #include "pin_repository.h" #include "engine_configuration.h" +#include "engine.h" #include "hardware.h" #include "mpu_util.h" diff --git a/firmware/development/rfi_perftest.cpp b/firmware/development/rfi_perftest.cpp index db42a88d52..6c747dce29 100644 --- a/firmware/development/rfi_perftest.cpp +++ b/firmware/development/rfi_perftest.cpp @@ -7,11 +7,11 @@ #include "global.h" #include "rfi_perftest.h" +#include "engine_math.h" #include "fuel_math.h" #include "eficonsole.h" #include "time.h" -#include "engine_math.h" #include "efiGpio.h" #include "efilib2.h" #include "console_io.h" diff --git a/simulator/simulator/rusEfiFunctionalTest.cpp b/simulator/simulator/rusEfiFunctionalTest.cpp index 4b455b6104..697c09a418 100644 --- a/simulator/simulator/rusEfiFunctionalTest.cpp +++ b/simulator/simulator/rusEfiFunctionalTest.cpp @@ -115,7 +115,7 @@ void rusEfiFunctionalTest(void) { initAlgo(&sharedLogger); commonInitEngineController(&sharedLogger); - initRpmCalculator(&sharedLogger, engine); + initRpmCalculator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); initTriggerCentral(&sharedLogger); initTriggerEmulator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);