From a1838388872d981e1e950c4c9d5597ccbc41fc4c Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Mon, 24 Jul 2017 17:05:55 +1000 Subject: [PATCH] Prevent occasional pulses when boost duty = 0%. Helps prevent overboost in some conditions --- speeduino/auxiliaries.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/speeduino/auxiliaries.ino b/speeduino/auxiliaries.ino index 66125cf3..4c6de520 100644 --- a/speeduino/auxiliaries.ino +++ b/speeduino/auxiliaries.ino @@ -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 {