check the real RPM at the instant the injector is about to open

This commit is contained in:
Matthew Kennedy 2025-02-09 01:33:42 -08:00
parent 81c1427c1e
commit b558469d0e
3 changed files with 12 additions and 1 deletions

View File

@ -281,6 +281,14 @@ LimpState LimpManager::allowIgnition() const {
return {true, ClearReason::None};
}
bool LimpManager::asyncCutInjection() {
if (!engineConfiguration->cutFuelOnHardLimit) {
return false;
}
return isHardRevLimit(Sensor::getOrZero(SensorType::Rpm));
}
float LimpManager::getTimeSinceAnyCut() const {
return m_lastCutTime.getElapsedSeconds();
}

View File

@ -121,6 +121,9 @@ public:
LimpState allowInjection() const;
LimpState allowIgnition() const;
// Last-minute check to determine whether to skip an injection due to hard rev limiter
bool asyncCutInjection();
float getTimeSinceAnyCut() const;
bool allowTriggerInput() const;

View File

@ -53,7 +53,7 @@ void InjectorOutputPin::open(efitick_t nowNt) {
LogTriggerInjectorState(nowNt, true);
#endif // EFI_TOOTH_LOGGER
if (!engineConfiguration->asyncRevLimit || getLimpManager()->allowInjection().value) {
if (!engineConfiguration->asyncRevLimit || !getLimpManager()->asyncCutInjection()) {
setHigh();
}
}