️ Controller Fan software PWM (etc.) (#23102)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Mike La Spina
2021-11-14 05:55:31 -06:00
committed by Scott Lahteine
parent 49e233e06f
commit e0c439fe91
8 changed files with 76 additions and 80 deletions

View File

@ -72,10 +72,14 @@ void ControllerFan::update() {
? settings.active_speed : settings.idle_speed
);
if (PWM_PIN(CONTROLLER_FAN_PIN))
set_pwm_duty(pin_t(CONTROLLER_FAN_PIN), speed);
else
WRITE(CONTROLLER_FAN_PIN, speed);
#if ENABLED(FAN_SOFT_PWM)
thermalManager.soft_pwm_controller_speed = speed;
#else
if (PWM_PIN(CONTROLLER_FAN_PIN))
set_pwm_duty(pin_t(CONTROLLER_FAN_PIN), speed);
else
WRITE(CONTROLLER_FAN_PIN, speed > 0);
#endif
}
}