rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
antilag_system.cpp
Go to the documentation of this file.
1/*
2 * @file antilag_system.cpp
3 *
4 * @date 26. nov. 2022
5 * Author: Turbo Marian
6 */
7
8#include "pch.h"
9
10#if EFI_ANTILAG_SYSTEM
11#include "antilag_system.h"
12#include "engine_state.h"
13#include "fuel_math.h"
14
17
20#if EFI_PROD_CODE
22#else
23 ALSActivatePinState = false;
24#endif
25 }
27 } else if (engineConfiguration->antiLagActivationMode == LUA_ANTILAG) {
28 return luaAntilagState;
29 } else if (engineConfiguration->antiLagActivationMode == ALWAYS_ON_ANTILAG) {
30 return true;
31 } else {
32 criticalError("Unexpected antiLagActivationMode");
33 return false;
34 }
35}
36
38 return engineConfiguration->ALSMinRPM < rpm;
39}
40
42 return engineConfiguration->ALSMaxRPM > rpm;
43}
44
50
56
62
64 auto ALStime = ALStimer.getElapsedSeconds();
65
66 return ALStime < engineConfiguration->ALSMaxDuration;
67}
68
92
96
97 if (!ALSMaxRPMCondition) {
98 ALStimer.reset();
99 }
100
101#if EFI_ANTILAG_SYSTEM
103#endif // EFI_ANTILAG_SYSTEM
104}
105
106#endif /* EFI_ANTILAG_SYSTEM */
bool isALSMinCLTCondition() const
bool isALSMinRPMCondition(float rpm) const
bool isALSMaxThrottleIntentCondition() const
bool isALSMaxCLTCondition() const
bool isInsideALSSwitchCondition()
bool isAntilagConditionMet(float rpm)
bool isALSMaxRPMCondition(float rpm) const
static float getOrZero(SensorType type)
Definition sensor.h:83
static constexpr engine_configuration_s * engineConfiguration
One header which acts as gateway to current engine state.
percent_t getFuelALSCorrection(float rpm)
static CCM_OPTIONAL FunctionalSensor clt(SensorType::Clt, MS2NT(10))
bool efiReadPin(brain_pin_e pin)
Definition io_pins.cpp:89
bool isBrainPinValid(brain_pin_e brainPin)
@ DriverThrottleIntent