Allows user to set (almost) any PWM frequency (#12638)

This commit is contained in:
Reece Kibble
2019-03-08 16:15:42 +08:00
committed by Scott Lahteine
parent afbec5ff7e
commit dbead66988
80 changed files with 2314 additions and 28 deletions

View File

@ -1273,6 +1273,18 @@ void Planner::check_axes_activity() {
#if HAS_FAN2
thermalManager.soft_pwm_amount_fan[2] = CALC_FAN_SPEED(2);
#endif
#elif ENABLED(FAST_PWM_FAN)
#if HAS_FAN0
thermalManager.set_pwm_duty(FAN_PIN, CALC_FAN_SPEED(0));
#endif
#if HAS_FAN1
thermalManager.set_pwm_duty(FAN1_PIN, CALC_FAN_SPEED(1));
#endif
#if HAS_FAN2
thermalManager.set_pwm_duty(FAN2_PIN, CALC_FAN_SPEED(2));
#endif
#else
#if HAS_FAN0
analogWrite(FAN_PIN, CALC_FAN_SPEED(0));