Prevent occasional pulses when boost duty = 0%. Helps prevent overboost in some conditions

This commit is contained in:
Josh Stewart 2017-07-24 17:05:55 +10:00
parent f11cae0eb8
commit a183838887
1 changed files with 3 additions and 1 deletions

View File

@ -84,7 +84,9 @@ void boostControl()
boostPID.Compute();
currentStatus.boostDuty = (unsigned long)(boost_pwm_target_value * 100UL) / boost_pwm_max_count;
ENABLE_BOOST_TIMER(); //Turn on the compare unit (ie turn on the interrupt)
if(currentStatus.boostDuty == 0) { DISABLE_BOOST_TIMER(); BOOST_PIN_LOW(); } //If boost duty is 0, shut everything down
else { ENABLE_BOOST_TIMER(); } //Turn on the compare unit (ie turn on the interrupt) if boost duty >0
}
else
{