parent
318aa6d8c9
commit
6146b01a36
|
@ -19,7 +19,9 @@ bool AntilagSystemBase::isInsideALSSwitchCondition() {
|
|||
|
||||
if (isALSSwitchActivated) {
|
||||
if (isBrainPinValid(engineConfiguration->ALSActivatePin)) {
|
||||
#if EFI_PROD_CODE
|
||||
ALSActivatePinState = engineConfiguration->ALSActivateInverted ^ efiReadPin(engineConfiguration->ALSActivatePin);
|
||||
#endif
|
||||
}
|
||||
return ALSActivatePinState;
|
||||
} else {
|
||||
|
|
|
@ -24,19 +24,3 @@ public:
|
|||
bool isAntilagConditionMet();
|
||||
bool isInsideALSSwitchCondition();
|
||||
};
|
||||
|
||||
/**
|
||||
* See also SoftLimiterSandbox.java
|
||||
*/
|
||||
class ALSSoftSparkLimiter {
|
||||
public:
|
||||
/**
|
||||
* targetSkipRatio of '0' means 'do not skip', would always return false
|
||||
*/
|
||||
void setTargetSkipRatio(float ALSSkipRatio);
|
||||
|
||||
bool shouldSkip();
|
||||
private:
|
||||
bool wasJustSkipped = false;
|
||||
float ALSSkipRatio = 0;
|
||||
};
|
||||
|
|
|
@ -166,9 +166,12 @@ public:
|
|||
|
||||
#if EFI_ANTILAG_SYSTEM
|
||||
AntilagSystemBase antilagController;
|
||||
SoftSparkLimiter ALSsoftSparkLimiter;
|
||||
#endif // EFI_ANTILAG_SYSTEM
|
||||
|
||||
#if EFI_ANTILAG_SYSTEM
|
||||
SoftSparkLimiter ALSsoftSparkLimiter;
|
||||
#endif /* EFI_ANTILAG_SYSTEM */
|
||||
|
||||
#if EFI_BOOST_CONTROL
|
||||
BoostController boostController;
|
||||
#endif // EFI_BOOST_CONTROL
|
||||
|
|
|
@ -192,6 +192,10 @@ void EngineState::periodicFastCallback() {
|
|||
#if EFI_LAUNCH_CONTROL
|
||||
engine->launchController.update();
|
||||
#endif //EFI_LAUNCH_CONTROL
|
||||
|
||||
#if EFI_ANTILAG_SYSTEM
|
||||
engine->antilagController.update();
|
||||
#endif //EFI_ANTILAG_SYSTEM
|
||||
#endif // EFI_ENGINE_CONTROL
|
||||
}
|
||||
|
||||
|
|
|
@ -498,6 +498,14 @@ void onTriggerEventSparkLogic(int rpm, efitick_t edgeTimestamp, float currentPha
|
|||
}
|
||||
#endif // EFI_LAUNCH_CONTROL
|
||||
|
||||
#if EFI_ANTILAG_SYSTEM
|
||||
if (engine->ALSsoftSparkLimiter.shouldSkip()) {
|
||||
continue;
|
||||
}
|
||||
auto ALSSkipRatio = engineConfiguration->ALSSkipRatio;
|
||||
engine->ALSsoftSparkLimiter.setTargetSkipRatio(ALSSkipRatio);
|
||||
#endif // EFI_ANTILAG_SYSTEM
|
||||
|
||||
scheduleSparkEvent(limitedSpark, event, rpm, edgeTimestamp, currentPhase, nextPhase);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
#define EFI_TCU FALSE
|
||||
|
||||
#define EFI_ANTILAG_SYSTEM TRUE
|
||||
|
||||
#define ENABLE_PERF_TRACE FALSE
|
||||
|
||||
#define EFI_PRINTF_FUEL_DETAILS FALSE
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
#define EFI_ENABLE_ASSERTS TRUE
|
||||
|
||||
#define EFI_ANTILAG_SYSTEM TRUE
|
||||
|
||||
#define EFI_TUNER_STUDIO TRUE
|
||||
|
||||
#define EFI_EMULATE_POSITION_SENSORS TRUE
|
||||
|
|
Loading…
Reference in New Issue