CJ125 heater zero PWM improvement

This commit is contained in:
rusefi 2019-02-01 22:37:21 -05:00
parent a1e4880bb9
commit 5ced490687
2 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ void SimplePwm::setSimplePwmDutyCycle(float dutyCycle) {
warning(CUSTOM_ERR_6579, "spwd:dutyCycle %.2f", dutyCycle);
return;
}
if (dutyCycle == 0.0f) {
if (dutyCycle == 0.0f && stateChangeCallback != NULL) {
/**
* set the pin low just to be super sure
* this custom handling of zero value comes from CJ125 heater code

View File

@ -96,7 +96,7 @@ public:
/**
* this main callback is invoked when it's time to switch level on any of the output channels
*/
pwm_gen_callback *stateChangeCallback;
pwm_gen_callback *stateChangeCallback = NULL;
private:
/**
* float value of PWM period