diff --git a/firmware/controllers/actuators/boost_control.cpp b/firmware/controllers/actuators/boost_control.cpp index 061d83d9c1..f728f8b1f0 100644 --- a/firmware/controllers/actuators/boost_control.cpp +++ b/firmware/controllers/actuators/boost_control.cpp @@ -133,6 +133,11 @@ expected BoostController::getClosedLoop(float target, float manifoldP void BoostController::setOutput(expected output) { percent_t percent = output.value_or(engineConfiguration->boostControlSafeDutyCycle); + if (!engineConfiguration->isBoostControlEnabled) { + // If not enabled, force 0% output + percent = 0; + } + #if EFI_TUNER_STUDIO engine->outputChannels.boostControllerOutput = percent; #endif /* EFI_TUNER_STUDIO */ @@ -190,7 +195,7 @@ void setDefaultBoostParameters() { void startBoostPin() { #if !EFI_UNIT_TEST // Only init if a pin is set, no need to start PWM without a pin - if (!isBrainPinValid(engineConfiguration->boostControlPin)) { + if (!engineConfiguration->isBoostControlEnabled || !isBrainPinValid(engineConfiguration->boostControlPin)) { return; } @@ -200,7 +205,7 @@ void startBoostPin() { &engine->executor, &enginePins.boostPin, engineConfiguration->boostPwmFrequency, - 0.5f + 0 ); #endif /* EFI_UNIT_TEST */ } diff --git a/unit_tests/tests/test_boost.cpp b/unit_tests/tests/test_boost.cpp index 5308f0b13a..6f65127dd9 100644 --- a/unit_tests/tests/test_boost.cpp +++ b/unit_tests/tests/test_boost.cpp @@ -109,6 +109,8 @@ TEST(BoostControl, ClosedLoop) { TEST(BoostControl, SetOutput) { EngineTestHelper eth(TEST_ENGINE); + engineConfiguration->isBoostControlEnabled = true; + StrictMock pwm; StrictMock etb; BoostController bc;