From 32ae9f9ab702deaface2f63af3a658be2bf5c9d3 Mon Sep 17 00:00:00 2001 From: AnHardt Date: Thu, 8 Oct 2015 21:23:18 +0200 Subject: [PATCH] Fix stepper shutdown during waiting for temperatures In the wait loops of M109 M190 idle() is called, what checks stepper_inactive_time against previous_cmd_ms. Because we can be several minutes inside the loop, resetting previous_cmd_ms only outside the loop caused stepper shutdowns. The name of previous_cmd_ms does not really reflect its use. It's set not only when a new command was received or executed but also in many of the movement routines. For that the little extension of using it during the wait will (hopefully) not hurt. # Conflicts: # Marlin/Configuration_adv.h --- Marlin/Marlin_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e841389452..d2a2120973 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3975,6 +3975,7 @@ inline void gcode_M109() { } idle(); + refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out #ifdef TEMP_RESIDENCY_TIME // start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time @@ -3989,7 +3990,6 @@ inline void gcode_M109() { } LCD_MESSAGEPGM(MSG_HEATING_COMPLETE); - refresh_cmd_timeout(); print_job_start_ms = previous_cmd_ms; } @@ -4024,9 +4024,9 @@ inline void gcode_M109() { #endif } idle(); + refresh_cmd_timeout(); // to prevent stepper_inactive_time from running out } LCD_MESSAGEPGM(MSG_BED_DONE); - refresh_cmd_timeout(); } #endif // HAS_TEMP_BED