ALS: Timer added
(cherry picked from commit 1c88ef4dc682622bbf15ae7de6ad87d6b1fee2b4)
This commit is contained in:
parent
63fb0cf5f9
commit
c0ef3eff2b
|
@ -59,6 +59,12 @@ bool AntilagSystemBase::isALSMaxThrottleIntentCondition() const {
|
|||
return engineConfiguration->ALSMaxTPS > throttleIntent;
|
||||
}
|
||||
|
||||
bool AntilagSystemBase::isInsideALSTimerCondition() {
|
||||
auto ALStime = ALStimer.getElapsedSeconds();
|
||||
|
||||
return ALStime < engineConfiguration->ALSMaxDuration;
|
||||
}
|
||||
|
||||
bool AntilagSystemBase::isAntilagConditionMet(int rpm) {
|
||||
|
||||
|
||||
|
@ -68,19 +74,23 @@ bool AntilagSystemBase::isAntilagConditionMet(int rpm) {
|
|||
ALSMaxCLTCondition = isALSMaxCLTCondition();
|
||||
ALSMaxThrottleIntentCondition = isALSMaxThrottleIntentCondition();
|
||||
ALSSwitchCondition = isInsideALSSwitchCondition();
|
||||
ALSTimerCondition = isInsideALSTimerCondition();
|
||||
|
||||
return ALSMinRPMCondition &&
|
||||
ALSMaxRPMCondition &&
|
||||
ALSMinCLTCondition &&
|
||||
ALSMaxCLTCondition &&
|
||||
ALSMaxThrottleIntentCondition &&
|
||||
ALSSwitchCondition;
|
||||
ALSSwitchCondition &&
|
||||
ALSTimerCondition;
|
||||
}
|
||||
|
||||
void AntilagSystemBase::update() {
|
||||
int rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||
isAntilagCondition = engineConfiguration->antiLagEnabled && isAntilagConditionMet(rpm);
|
||||
|
||||
if (!ALSMinRPMCondition) {ALStimer.reset();}
|
||||
|
||||
#if EFI_ANTILAG_SYSTEM
|
||||
fuelALSCorrection = getFuelALSCorrection(rpm);
|
||||
#endif // EFI_ANTILAG_SYSTEM
|
||||
|
|
|
@ -22,6 +22,7 @@ public:
|
|||
bool isALSMaxCLTCondition() const;
|
||||
bool isALSMaxThrottleIntentCondition() const;
|
||||
bool isInsideALSSwitchCondition();
|
||||
bool isInsideALSTimerCondition();
|
||||
/* enabled and all conditions above */
|
||||
bool isAntilagConditionMet(int rpm);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue