fix no-MAP DFCO #457

This commit is contained in:
Matthew Kennedy 2024-08-05 13:48:18 -07:00
parent 1452a1dcc7
commit 828fde7ea6
2 changed files with 8 additions and 2 deletions

View File

@ -47,6 +47,7 @@ or
- Make Toyota "3 Tooth Cam" decoder more robust #382
- Flex sensor-derived fuel temperature indication works properly
- Fix a scenario where noisy trigger can cause overdwell [rusefi/rusefi#6349](https://github.com/rusefi/rusefi/issues/6349)
- Fix DFCO on engines without a MAP sensor #457
## December 2023 Release

View File

@ -14,14 +14,19 @@ bool DfcoController::getState() const {
const auto map = Sensor::get(SensorType::Map);
// If some sensor is broken, inhibit DFCO
if (!tps || !clt || !map) {
if (!tps || !clt) {
return false;
}
// MAP sensor is optional, only inhibit if the sensor is present but broken
if (Sensor::hasSensor(SensorType::Map) && !map) {
return false;
}
float rpm = Sensor::getOrZero(SensorType::Rpm);
float vss = Sensor::getOrZero(SensorType::VehicleSpeed);
bool mapActivate = map.Value < engineConfiguration->coastingFuelCutMap;
bool mapActivate = map.value_or(0) < engineConfiguration->coastingFuelCutMap;
bool tpsActivate = tps.Value < engineConfiguration->coastingFuelCutTps;
bool cltActivate = clt.Value > engineConfiguration->coastingFuelCutClt;
// True if throttle, MAP, and CLT are all acceptable for DFCO to occur