Browse Source

TM: reset fan measuring state when changing speed

Ensure that fan checks are reset and use the new speed at each step of
the calibration.

This also gives extra time to the fan to ramp-up from a cold start,
when a fancheck could previously start right *after* the speed change.

Should fix #3791
Yuri D'Elia 2 years ago
parent
commit
c05ac535be
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Firmware/temperature.cpp

+ 5 - 0
Firmware/temperature.cpp

@@ -2630,6 +2630,11 @@ namespace temp_model_cal {
 // set current fan speed for both front/backend
 static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed)
 {
+#if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1)
+    // reset the fan measuring state due to missing hysteresis handling on the checking side
+    fan_measuring = false;
+    extruder_autofan_last_check = _millis();
+#endif
     fanSpeed = fan_speed;
 #ifdef FAN_SOFT_PWM
     fanSpeedSoftPwm = fan_speed;