mirror of https://github.com/rusefi/rusefi-1.git
refactoring: reducing header tree hell
This commit is contained in:
parent
db80801191
commit
2756ff57eb
|
@ -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
|
* there is an implicit dependency on the fact that 'tachometer' listener is the 1st listener - this case
|
||||||
* other listeners can access current RPM value
|
* other listeners can access current RPM value
|
||||||
*/
|
*/
|
||||||
initRpmCalculator(sharedLogger, engine);
|
initRpmCalculator(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||||
|
|
||||||
#if (EFI_PROD_CODE && EFI_ENGINE_CONTROL) || defined(__DOXYGEN__)
|
#if (EFI_PROD_CODE && EFI_ENGINE_CONTROL) || defined(__DOXYGEN__)
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2018
|
* @author Andrey Belomutskiy, (c) 2012-2018
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "engine_math.h"
|
||||||
#include "aux_valves.h"
|
#include "aux_valves.h"
|
||||||
#include "allsensors.h"
|
#include "allsensors.h"
|
||||||
#include "trigger_central.h"
|
#include "trigger_central.h"
|
||||||
#include "engine_math.h"
|
|
||||||
|
|
||||||
EXTERN_ENGINE
|
EXTERN_ENGINE
|
||||||
;
|
;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
#include "engine.h"
|
||||||
#include "trigger_bmw.h"
|
#include "trigger_bmw.h"
|
||||||
#include "trigger_chrysler.h"
|
#include "trigger_chrysler.h"
|
||||||
#include "trigger_gm.h"
|
#include "trigger_gm.h"
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
|
|
||||||
#include "trigger_toyota.h"
|
#include "trigger_toyota.h"
|
||||||
|
|
||||||
EXTERN_ENGINE;
|
|
||||||
|
|
||||||
void initialize2jzGE1_12(TriggerShape *s) {
|
void initialize2jzGE1_12(TriggerShape *s) {
|
||||||
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#ifndef CONTROLLERS_TRIGGER_TRIGGER_TOYOTA_H_
|
#ifndef CONTROLLERS_TRIGGER_TRIGGER_TOYOTA_H_
|
||||||
#define CONTROLLERS_TRIGGER_TRIGGER_TOYOTA_H_
|
#define CONTROLLERS_TRIGGER_TRIGGER_TOYOTA_H_
|
||||||
|
|
||||||
#include "engine.h"
|
#include "trigger_structure.h"
|
||||||
|
|
||||||
void initialize2jzGE1_12(TriggerShape *s);
|
void initialize2jzGE1_12(TriggerShape *s);
|
||||||
void initialize2jzGE3_34(TriggerShape *s);
|
void initialize2jzGE3_34(TriggerShape *s);
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2018
|
* @author Andrey Belomutskiy, (c) 2012-2018
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "global.h"
|
|
||||||
#include "rpm_calculator.h"
|
#include "rpm_calculator.h"
|
||||||
|
#include "engine.h"
|
||||||
|
|
||||||
#if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__)
|
#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);
|
return rpm == 0 ? NAN : timeSinceZeroAngleNt / getOneDegreeTimeNt(rpm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initRpmCalculator(Logging *sharedLogger, Engine *engine) {
|
void initRpmCalculator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
logger = sharedLogger;
|
logger = sharedLogger;
|
||||||
if (hasFirmwareError()) {
|
if (hasFirmwareError()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#define RPM_REPORTER_H_
|
#define RPM_REPORTER_H_
|
||||||
|
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include "engine_configuration.h"
|
|
||||||
#include "scheduler.h"
|
#include "scheduler.h"
|
||||||
|
|
||||||
#define TOP_DEAD_CENTER_MESSAGE "r"
|
#define TOP_DEAD_CENTER_MESSAGE "r"
|
||||||
|
@ -34,8 +33,6 @@
|
||||||
#define RPM_LOW_THRESHOLD 25
|
#define RPM_LOW_THRESHOLD 25
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/**
|
/**
|
||||||
* The engine is not spinning, RPM=0
|
* The engine is not spinning, RPM=0
|
||||||
|
@ -56,8 +53,6 @@ typedef enum {
|
||||||
RUNNING,
|
RUNNING,
|
||||||
} spinning_state_e;
|
} spinning_state_e;
|
||||||
|
|
||||||
class Engine;
|
|
||||||
|
|
||||||
#define GET_RPM() ( ENGINE(rpmCalculator.rpmValue) )
|
#define GET_RPM() ( ENGINE(rpmCalculator.rpmValue) )
|
||||||
|
|
||||||
class RpmCalculator {
|
class RpmCalculator {
|
||||||
|
@ -166,11 +161,9 @@ void rpmShaftPositionCallback(trigger_event_e ckpSignalType, uint32_t index DECL
|
||||||
/**
|
/**
|
||||||
* @brief Initialize RPM calculator
|
* @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);
|
float getCrankshaftAngleNt(efitime_t timeNt DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
int getRevolutionCounter(void);
|
int getRevolutionCounter(void);
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#if EFI_EMULATE_POSITION_SENSORS || defined(__DOXYGEN__)
|
#if EFI_EMULATE_POSITION_SENSORS || defined(__DOXYGEN__)
|
||||||
|
|
||||||
|
#include "engine.h"
|
||||||
#include "trigger_emulator_algo.h"
|
#include "trigger_emulator_algo.h"
|
||||||
#include "engine_configuration.h"
|
#include "engine_configuration.h"
|
||||||
#include "trigger_central.h"
|
#include "trigger_central.h"
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "eficonsole.h"
|
#include "eficonsole.h"
|
||||||
#include "pin_repository.h"
|
#include "pin_repository.h"
|
||||||
#include "engine_configuration.h"
|
#include "engine_configuration.h"
|
||||||
|
#include "engine.h"
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
#include "mpu_util.h"
|
#include "mpu_util.h"
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "rfi_perftest.h"
|
#include "rfi_perftest.h"
|
||||||
|
#include "engine_math.h"
|
||||||
#include "fuel_math.h"
|
#include "fuel_math.h"
|
||||||
|
|
||||||
#include "eficonsole.h"
|
#include "eficonsole.h"
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
#include "engine_math.h"
|
|
||||||
#include "efiGpio.h"
|
#include "efiGpio.h"
|
||||||
#include "efilib2.h"
|
#include "efilib2.h"
|
||||||
#include "console_io.h"
|
#include "console_io.h"
|
||||||
|
|
|
@ -115,7 +115,7 @@ void rusEfiFunctionalTest(void) {
|
||||||
initAlgo(&sharedLogger);
|
initAlgo(&sharedLogger);
|
||||||
commonInitEngineController(&sharedLogger);
|
commonInitEngineController(&sharedLogger);
|
||||||
|
|
||||||
initRpmCalculator(&sharedLogger, engine);
|
initRpmCalculator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
initTriggerCentral(&sharedLogger);
|
initTriggerCentral(&sharedLogger);
|
||||||
initTriggerEmulator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
initTriggerEmulator(&sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
Loading…
Reference in New Issue