From 88e4dffe883036b73c224df8aa45d877e65ff93f Mon Sep 17 00:00:00 2001 From: Giuliano Zaro <3684609+GMagician@users.noreply.github.com> Date: Thu, 18 Jun 2020 23:05:12 +0200 Subject: [PATCH] Fix PID autotune timeout (#18352) --- Marlin/src/module/temperature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 23c3d90a3c..16e29f7b36 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -568,7 +568,7 @@ volatile bool Temperature::raw_temps_ready = false; #ifndef MAX_CYCLE_TIME_PID_AUTOTUNE #define MAX_CYCLE_TIME_PID_AUTOTUNE 20L #endif - if (((ms - t1) + (ms - t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { + if ((ms - _MIN(t1, t2)) > (MAX_CYCLE_TIME_PID_AUTOTUNE * 60L * 1000L)) { TERN_(DWIN_CREALITY_LCD, Popup_Window_Temperature(0)); TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT)); SERIAL_ECHOLNPGM(STR_PID_TIMEOUT);