浏览代码

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 年之前
父节点
当前提交
c05ac535be
共有 1 个文件被更改,包括 5 次插入0 次删除
  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;