From c05ac535be5ab479b1ead4e9aa17c1c3353f231a Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Fri, 9 Dec 2022 12:57:25 +0100 Subject: [PATCH] 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 --- Firmware/temperature.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 88d2af8fc..d48b4c1fc 100755 --- a/Firmware/temperature.cpp +++ b/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;