Init values to FAN_OFF_PWM, compare for greater than instead of not equal to in order to catch edge cases
This commit is contained in:
@@ -76,7 +76,7 @@ void ControllerFan::update() {
|
||||
|
||||
#if FAN_KICKSTART_TIME
|
||||
static millis_t fan_kick_end = 0;
|
||||
if (speed != FAN_OFF_PWM) {
|
||||
if (speed > FAN_OFF_PWM) {
|
||||
if (!fan_kick_end) {
|
||||
fan_kick_end = ms + FAN_KICKSTART_TIME; // May be longer based on slow update interval for controller fn check. Sets minimum
|
||||
speed = FAN_KICKSTART_POWER;
|
||||
|
||||
@@ -1300,7 +1300,7 @@ void Planner::recalculate(TERN_(HINTS_SAFE_EXIT_SPEED, const_float_t safe_exit_s
|
||||
|
||||
void Planner::kickstart_fan(uint8_t (&fan_speed)[FAN_COUNT], const millis_t &ms, const uint8_t f) {
|
||||
static millis_t fan_kick_end[FAN_COUNT] = { 0 };
|
||||
if (fan_speed[f] != FAN_OFF_PWM) {
|
||||
if (fan_speed[f] > FAN_OFF_PWM) {
|
||||
if (fan_kick_end[f] == 0) {
|
||||
fan_kick_end[f] = ms + FAN_KICKSTART_TIME;
|
||||
fan_speed[f] = FAN_KICKSTART_POWER;
|
||||
|
||||
@@ -309,19 +309,19 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
||||
#endif
|
||||
|
||||
#if EITHER(AUTO_POWER_E_FANS, HAS_FANCHECK)
|
||||
uint8_t Temperature::autofan_speed[HOTENDS]; // = { 0 }
|
||||
uint8_t Temperature::autofan_speed[HOTENDS] = {FAN_OFF_PWM};
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_POWER_CHAMBER_FAN)
|
||||
uint8_t Temperature::chamberfan_speed; // = 0
|
||||
uint8_t Temperature::chamberfan_speed = {FAN_OFF_PWM}
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_POWER_COOLER_FAN)
|
||||
uint8_t Temperature::coolerfan_speed; // = 0
|
||||
uint8_t Temperature::coolerfan_speed = {FAN_OFF_PWM};
|
||||
#endif
|
||||
|
||||
#if BOTH(FAN_SOFT_PWM, USE_CONTROLLER_FAN)
|
||||
uint8_t Temperature::soft_pwm_controller_speed;
|
||||
uint8_t Temperature::soft_pwm_controller_speed = {FAN_OFF_PWM};
|
||||
#endif
|
||||
|
||||
// Init fans according to whether they're native PWM or Software PWM
|
||||
@@ -345,11 +345,11 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
||||
// HAS_FAN does not include CONTROLLER_FAN
|
||||
#if HAS_FAN
|
||||
|
||||
uint8_t Temperature::fan_speed[FAN_COUNT]; // = { 0 }
|
||||
uint8_t Temperature::fan_speed[FAN_COUNT] = {FAN_OFF_PWM};
|
||||
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
|
||||
Temperature::extra_fan_t Temperature::extra_fan_speed[FAN_COUNT];
|
||||
Temperature::extra_fan_t Temperature::extra_fan_speed[FAN_COUNT] = {FAN_OFF_PWM};
|
||||
|
||||
/**
|
||||
* Handle the M106 P<fan> T<speed> command:
|
||||
@@ -376,7 +376,7 @@ PGMSTR(str_t_heating_failed, STR_T_HEATING_FAILED);
|
||||
|
||||
#if EITHER(PROBING_FANS_OFF, ADVANCED_PAUSE_FANS_PAUSE)
|
||||
bool Temperature::fans_paused; // = false;
|
||||
uint8_t Temperature::saved_fan_speed[FAN_COUNT]; // = { 0 }
|
||||
uint8_t Temperature::saved_fan_speed[FAN_COUNT] = {FAN_OFF_PWM};
|
||||
#endif
|
||||
|
||||
#if ENABLED(ADAPTIVE_FAN_SLOWING)
|
||||
|
||||
@@ -917,7 +917,7 @@ void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_axis, 0.
|
||||
#if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
|
||||
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
|
||||
gcode.dwell(SEC_TO_MS(toolchange_settings.fan_time));
|
||||
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
|
||||
thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = FAN_OFF_PWM;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user