RPM refactoring
This commit is contained in:
parent
3e8785b060
commit
d20803e942
|
@ -208,7 +208,7 @@ static msg_t ivThread(int param) {
|
||||||
|
|
||||||
if (timeToStopBlip != 0) {
|
if (timeToStopBlip != 0) {
|
||||||
iacPosition = blipIdlePosition;
|
iacPosition = blipIdlePosition;
|
||||||
} else if (isCrankingOrInitialE(engine)) {
|
} else if (!engine->rpmCalculator.isRunning(PASS_ENGINE_PARAMETER_SIGNATURE)) {
|
||||||
// during cranking it's always manual mode, PID would make no sence during cranking
|
// during cranking it's always manual mode, PID would make no sence during cranking
|
||||||
iacPosition = cltCorrection * engineConfiguration->crankingIACposition;
|
iacPosition = cltCorrection * engineConfiguration->crankingIACposition;
|
||||||
} else if (engineConfiguration->idleMode == IM_MANUAL) {
|
} else if (engineConfiguration->idleMode == IM_MANUAL) {
|
||||||
|
|
|
@ -169,14 +169,6 @@ int RpmCalculator::getRpm(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
return rpmValue;
|
return rpmValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
|
|
||||||
bool isCrankingOrInitialE(Engine *engine) {
|
|
||||||
int rpm = getRpmE(engine);
|
|
||||||
return ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE) || (rpm == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Shaft position callback used by RPM calculation logic.
|
* @brief Shaft position callback used by RPM calculation logic.
|
||||||
*
|
*
|
||||||
|
|
|
@ -65,10 +65,6 @@ public:
|
||||||
/**
|
/**
|
||||||
* Returns true if the engine is running and not cranking
|
* Returns true if the engine is running and not cranking
|
||||||
*/
|
*/
|
||||||
// bool isRunning();
|
|
||||||
/**
|
|
||||||
* Please note that this is a relatively heavy method due to getTimeNowNt() usage
|
|
||||||
*/
|
|
||||||
bool isRunning(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
bool isRunning(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,7 +112,6 @@ private:
|
||||||
*/
|
*/
|
||||||
#define getRpmE(engine) (engine)->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)
|
#define getRpmE(engine) (engine)->rpmCalculator.getRpm(PASS_ENGINE_PARAMETER_SIGNATURE)
|
||||||
|
|
||||||
bool isCrankingOrInitialE(Engine *engine);
|
|
||||||
void rpmShaftPositionCallback(trigger_event_e ckpSignalType, uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void rpmShaftPositionCallback(trigger_event_e ckpSignalType, uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
/**
|
/**
|
||||||
* @brief Initialize RPM calculator
|
* @brief Initialize RPM calculator
|
||||||
|
|
Loading…
Reference in New Issue