diff --git a/firmware/CHANGELOG.md b/firmware/CHANGELOG.md index 256b91e8a5..522852e28d 100644 --- a/firmware/CHANGELOG.md +++ b/firmware/CHANGELOG.md @@ -45,6 +45,7 @@ or - Add two more aux linear sensors #476 - Support wasted spark on odd cylinder count and odd-fire engines. Improves startup and allows running without a cam sensor! - Add an option for the DFCO MAP threshold to use a table dependent upon RPM #485 (thank you @alrijleh!) + - Option to disable DFCO on gear shift - Ability to use an 8x8 table for after-start fuel multiplier that depends on CLT and engine run time ### Fixed diff --git a/firmware/controllers/algo/fuel/dfco.cpp b/firmware/controllers/algo/fuel/dfco.cpp index 6f2f060983..1620a95d2f 100644 --- a/firmware/controllers/algo/fuel/dfco.cpp +++ b/firmware/controllers/algo/fuel/dfco.cpp @@ -30,9 +30,9 @@ bool DfcoController::getState() const { float vss = Sensor::getOrZero(SensorType::VehicleSpeed); // Setting to allow clutch to block DFCO activation - bool clutchBlock = engineConfiguration->disableFuelCutOnClutch - && !engine->engineState.clutchUpState - && isBrainPinValid(engineConfiguration->clutchUpPin); + bool clutchActivate = !engineConfiguration->disableFuelCutOnClutch + || !isBrainPinValid(engineConfiguration->clutchUpPin) + || engine->engineState.clutchUpState; float mapThreshold = engineConfiguration->useTableForDfcoMap ? interpolate2d(rpm, config->dfcoMapRpmValuesBins, config->dfcoMapRpmValues) : @@ -42,7 +42,7 @@ bool DfcoController::getState() const { bool tpsActivate = tps.Value < engineConfiguration->coastingFuelCutTps; bool cltActivate = clt.Value > engineConfiguration->coastingFuelCutClt; // True if throttle, MAP, CLT, and Clutch are all acceptable for DFCO to occur - bool dfcoAllowed = mapActivate && tpsActivate && cltActivate && !clutchBlock; + bool dfcoAllowed = mapActivate && tpsActivate && cltActivate && clutchActivate; bool rpmActivate = (rpm > engineConfiguration->coastingFuelCutRpmHigh); bool rpmDeactivate = (rpm < engineConfiguration->coastingFuelCutRpmLow);