Do not cancel wait-for-temperature loops in disable_heaters()

Partially revert previous change: cancelling a single loop would often
advance the gcode stream to the next wait-for loop if executed at the
beginning of an SD print, implicitly turning off the flag again.

Cancel the loop directly in UnconditionalStop() which stops the command
queue as well in an atomic way, handling this correctly.
This commit is contained in:
Yuri D'Elia 2021-12-10 01:46:20 +01:00
parent 32d8d892f5
commit 320835a1b7
3 changed files with 3 additions and 3 deletions

View file

@ -10160,6 +10160,7 @@ void UnconditionalStop()
// Disable all heaters and unroll the temperature wait loop stack
disable_heater();
cancel_heatup = true;
// Clear any saved printing state
cancel_saved_printing();

View file

@ -1416,7 +1416,6 @@ void temp_runaway_stop(bool isPreheat, bool isBed)
void disable_heater()
{
cancel_heatup = true;
setAllTargetHotends(0);
setTargetBed(0);
#if defined(TEMP_0_PIN) && TEMP_0_PIN > -1

View file

@ -220,7 +220,7 @@ FORCE_INLINE bool isCoolingBed() {
#define CHECK_ALL_HEATERS (checkAllHotends()||(target_temperature_bed!=0))
int getHeaterPower(int heater);
void disable_heater(); // Disable all heaters and unroll the temperature wait loop stack
void disable_heater(); // Disable all heaters
void updatePID();