Ensure M109 handles autotemp

This commit is contained in:
Scott Lahteine 2018-09-29 02:10:51 -05:00
parent e4389f7d23
commit 1410e79e7f

View file

@ -89,8 +89,9 @@ void GcodeSuite::M109() {
if (target_extruder != active_extruder) return; if (target_extruder != active_extruder) return;
#endif #endif
const bool no_wait_for_cooling = parser.seenval('S'); const bool no_wait_for_cooling = parser.seenval('S'),
if (no_wait_for_cooling || parser.seenval('R')) { set_temp = no_wait_for_cooling || parser.seenval('R')
if (set_temp) {
const int16_t temp = parser.value_celsius(); const int16_t temp = parser.value_celsius();
thermalManager.setTargetHotend(temp, target_extruder); thermalManager.setTargetHotend(temp, target_extruder);
@ -123,11 +124,11 @@ void GcodeSuite::M109() {
#endif #endif
#endif #endif
} }
else return;
#if ENABLED(AUTOTEMP) #if ENABLED(AUTOTEMP)
planner.autotemp_M104_M109(); planner.autotemp_M104_M109();
#endif #endif
if (set_temp)
(void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling); (void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling);
} }