From feb21be0bebf4df4876ee30d7231ca1600208b37 Mon Sep 17 00:00:00 2001 From: Daniel Tobias Date: Wed, 27 Jul 2022 10:25:54 +1000 Subject: [PATCH] cl boost control above baro should use logical and/or (#901) --- speeduino/auxiliaries.ino | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/speeduino/auxiliaries.ino b/speeduino/auxiliaries.ino index 9553aa77..60b07633 100644 --- a/speeduino/auxiliaries.ino +++ b/speeduino/auxiliaries.ino @@ -391,7 +391,7 @@ void boostControl() if ( (configPage9.boostByGearEnabled > 0) && (configPage2.vssMode > 1) ){ boostByGear(); } else{ currentStatus.boostTarget = get3DTableValue(&boostTable, (currentStatus.TPS * 2), currentStatus.RPM) << 1; } //Boost target table is in kpa and divided by 2 } - if(((configPage15.boostControlEnable == EN_BOOST_CONTROL_BARO) & (currentStatus.MAP >= currentStatus.baro)) | ((configPage15.boostControlEnable == EN_BOOST_CONTROL_FIXED) & (currentStatus.MAP >= configPage15.boostControlEnableThreshold))) //Only enables boost control above baro pressure or above user defined threshold (User defined level is usually set to boost with wastegate actuator only boost level) + if(((configPage15.boostControlEnable == EN_BOOST_CONTROL_BARO) && (currentStatus.MAP >= currentStatus.baro)) || ((configPage15.boostControlEnable == EN_BOOST_CONTROL_FIXED) && (currentStatus.MAP >= configPage15.boostControlEnableThreshold))) //Only enables boost control above baro pressure or above user defined threshold (User defined level is usually set to boost with wastegate actuator only boost level) { //If flex fuel is enabled, there can be an adder to the boost target based on ethanol content if( configPage2.flexEnabled == 1 ) @@ -437,10 +437,7 @@ void boostControl() currentStatus.boostDuty = configPage15.boostDCWhenDisabled*100; boost_pwm_target_value = ((unsigned long)(currentStatus.boostDuty) * boost_pwm_max_count) / 10000; //Convert boost duty (Which is a % multiplied by 100) to a pwm count ENABLE_BOOST_TIMER(); //Turn on the compare unit (ie turn on the interrupt) if boost duty >0 - if(currentStatus.boostDuty==0){ - //If boost control does nothing disable PWM completely - boostDisable(); - } + if(currentStatus.boostDuty == 0) { boostDisable(); } //If boost control does nothing disable PWM completely } //MAP above boost + hyster } //Open / Cloosed loop