Browse Source

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.
Yuri D'Elia 2 years ago
parent
commit
320835a1b7
3 changed files with 3 additions and 3 deletions
  1. 2 1
      Firmware/Marlin_main.cpp
  2. 0 1
      Firmware/temperature.cpp
  3. 1 1
      Firmware/temperature.h

+ 2 - 1
Firmware/Marlin_main.cpp

@@ -294,7 +294,7 @@ uint8_t newFanSpeed = 0;
 	  bool powersupply = true;
   #endif
 
-bool cancel_heatup = false ;
+bool cancel_heatup = false;
 
 int8_t busy_state = NOT_BUSY;
 static long prev_busy_signal_ms = -1;
@@ -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();

+ 0 - 1
Firmware/temperature.cpp

@@ -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

+ 1 - 1
Firmware/temperature.h

@@ -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();