From 808f6329970a3ae4794b7117f1add14c35c65a05 Mon Sep 17 00:00:00 2001 From: randellhodges Date: Wed, 15 Apr 2020 23:12:09 -0500 Subject: [PATCH] Update print job timer with Chamber temp (#17552) --- Marlin/src/gcode/temp/M140_M190.cpp | 20 +++++++++++--------- Marlin/src/gcode/temp/M141_M191.cpp | 13 ++++++++++++- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Marlin/src/gcode/temp/M140_M190.cpp b/Marlin/src/gcode/temp/M140_M190.cpp index 2da438707..b0739a869 100644 --- a/Marlin/src/gcode/temp/M140_M190.cpp +++ b/Marlin/src/gcode/temp/M140_M190.cpp @@ -50,16 +50,18 @@ */ void GcodeSuite::M140() { if (DEBUGGING(DRYRUN)) return; - if (parser.seenval('S')) thermalManager.setTargetBed(parser.value_celsius()); + if (parser.seenval('S')) { + thermalManager.setTargetBed(parser.value_celsius()); - #if ENABLED(PRINTJOB_TIMER_AUTOSTART) - /** - * Stop the timer at the end of print. Both hotend and bed target - * temperatures need to be set below mintemp. Order of M140 and M104 - * at the end of the print does not matter. - */ - thermalManager.check_timer_autostart(false, true); - #endif + #if ENABLED(PRINTJOB_TIMER_AUTOSTART) + /** + * Stop the timer at the end of print. Hotend, bed target, and chamber + * temperatures need to be set below mintemp. Order of M140, M104, and M141 + * at the end of the print does not matter. + */ + thermalManager.check_timer_autostart(false, true); + #endif + } } /** diff --git a/Marlin/src/gcode/temp/M141_M191.cpp b/Marlin/src/gcode/temp/M141_M191.cpp index 3f0283647..d76ba56c9 100644 --- a/Marlin/src/gcode/temp/M141_M191.cpp +++ b/Marlin/src/gcode/temp/M141_M191.cpp @@ -51,7 +51,18 @@ */ void GcodeSuite::M141() { if (DEBUGGING(DRYRUN)) return; - if (parser.seenval('S')) thermalManager.setTargetChamber(parser.value_celsius()); + if (parser.seenval('S')) { + thermalManager.setTargetChamber(parser.value_celsius()); + + #if ENABLED(PRINTJOB_TIMER_AUTOSTART) + /** + * Stop the timer at the end of print. Hotend, bed target, and chamber + * temperatures need to be set below mintemp. Order of M140, M104, and M141 + * at the end of the print does not matter. + */ + thermalManager.check_timer_autostart(false, true); + #endif + } } /**