Allow non-zero "fan off" PWM value (#15709)

This commit is contained in:
LinFor 2019-11-11 01:33:56 +03:00 committed by Scott Lahteine
parent 770adcfa15
commit 48b7a1e66e
76 changed files with 234 additions and 3 deletions

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -1302,8 +1302,15 @@
/**
* MIN/MAX fan PWM scaling
*/
#ifndef FAN_OFF_PWM
#define FAN_OFF_PWM 0
#endif
#ifndef FAN_MIN_PWM
#define FAN_MIN_PWM 0
#if FAN_OFF_PWM > 0
#define FAN_MIN_PWM (FAN_OFF_PWM + 1)
#else
#define FAN_MIN_PWM 0
#endif
#endif
#ifndef FAN_MAX_PWM
#define FAN_MAX_PWM 255
@ -1314,6 +1321,8 @@
#error "FAN_MAX_PWM must be a value from 0 to 255."
#elif FAN_MIN_PWM > FAN_MAX_PWM
#error "FAN_MIN_PWM must be less than or equal to FAN_MAX_PWM."
#elif FAN_OFF_PWM > FAN_MIN_PWM
#error "FAN_OFF_PWM must be less than or equal to FAN_MIN_PWM."
#endif
/**

View file

@ -1285,9 +1285,9 @@ void Planner::check_axes_activity() {
#endif
#if FAN_MIN_PWM != 0 || FAN_MAX_PWM != 255
#define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? map(tail_fan_speed[f], 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : 0)
#define CALC_FAN_SPEED(f) (tail_fan_speed[f] ? map(tail_fan_speed[f], 1, 255, FAN_MIN_PWM, FAN_MAX_PWM) : FAN_OFF_PWM)
#else
#define CALC_FAN_SPEED(f) tail_fan_speed[f]
#define CALC_FAN_SPEED(f) (tail_fan_speed[f] ?: FAN_OFF_PWM)
#endif
#if ENABLED(FAN_SOFT_PWM)

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -294,6 +294,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
#define FAN_KICKSTART_TIME 800
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -289,6 +289,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -295,6 +295,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -295,6 +295,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*

View file

@ -290,6 +290,9 @@
// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
//#define FAN_KICKSTART_TIME 100
// Some coolers may require a non-zero "off" state.
//#define FAN_OFF_PWM 1
/**
* PWM Fan Scaling
*