refactoring launch
This commit is contained in:
parent
4002c92dcc
commit
f510cb8b29
|
@ -15,8 +15,6 @@
|
||||||
#include "engine_state.h"
|
#include "engine_state.h"
|
||||||
#include "advance_map.h"
|
#include "advance_map.h"
|
||||||
|
|
||||||
static bool isInit = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We can have active condition from switch or from clutch.
|
* We can have active condition from switch or from clutch.
|
||||||
* In case we are dependent on VSS we just return true.
|
* In case we are dependent on VSS we just return true.
|
||||||
|
@ -97,17 +95,10 @@ bool LaunchControlBase::isLaunchConditionMet(int rpm) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaunchControlBase::update() {
|
void LaunchControlBase::update() {
|
||||||
|
|
||||||
if (!CONFIG(launchControlEnabled)) {
|
if (!CONFIG(launchControlEnabled)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ! EFI_UNIT_TEST
|
|
||||||
if(!isInit) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int rpm = GET_RPM();
|
int rpm = GET_RPM();
|
||||||
bool combinedConditions = isLaunchConditionMet(rpm);
|
bool combinedConditions = isLaunchConditionMet(rpm);
|
||||||
float timeDelay = CONFIG(launchActivateDelay);
|
float timeDelay = CONFIG(launchActivateDelay);
|
||||||
|
@ -175,8 +166,6 @@ void LaunchControlBase::applyLaunchControlLimiting(bool *limitedSpark, bool *lim
|
||||||
|
|
||||||
void initLaunchControl(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
void initLaunchControl(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engine->launchController.inject(PASS_ENGINE_PARAMETER_SIGNATURE);
|
engine->launchController.inject(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
isInit = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* EFI_LAUNCH_CONTROL */
|
#endif /* EFI_LAUNCH_CONTROL */
|
||||||
|
|
Loading…
Reference in New Issue