cl boost control above baro should use logical and/or (#901)

This commit is contained in:
Daniel Tobias 2022-07-27 10:25:54 +10:00 committed by Josh Stewart
parent 91c62e6229
commit feb21be0be
1 changed files with 2 additions and 5 deletions

View File

@ -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