refactor ON_HALT, add THEKERNEL->is_halted() for modules that just need to test it...
[clinton/Smoothieware.git] / src / modules / tools / temperaturecontrol / TemperatureControl.cpp
index a9915f5..e2bcb99 100644 (file)
@@ -330,7 +330,7 @@ void TemperatureControl::on_gcode_received(void *argument)
                         while ( get_temperature() < target_temperature ) {
                             THEKERNEL->call_event(ON_IDLE, this);
                             // check if ON_HALT was called (usually by kill button)
-                            if(this->target_temperature == UNDEFINED) break;
+                            if(THEKERNEL->is_halted() || this->target_temperature == UNDEFINED) break;
                         }
                         this->waiting = false;
                     }