print out message when M109 or homing aborted by kill
authorJim Morris <morris@wolfman.com>
Wed, 23 Sep 2015 21:21:07 +0000 (14:21 -0700)
committerJim Morris <morris@wolfman.com>
Wed, 23 Sep 2015 21:21:07 +0000 (14:21 -0700)
abort zprobe on kill

src/modules/tools/endstops/Endstops.cpp
src/modules/tools/temperaturecontrol/TemperatureControl.cpp
src/modules/tools/zprobe/ZProbe.cpp

index c78add9..7f7d3b1 100644 (file)
@@ -643,7 +643,7 @@ void Endstops::on_gcode_received(void *argument)
                         home(a);
                     }
                     // check if on_halt (eg kill)
-                    if(THEKERNEL->is_halted()) return;
+                    if(THEKERNEL->is_halted()) break;
                 }
 
             }else {
@@ -652,7 +652,10 @@ void Endstops::on_gcode_received(void *argument)
             }
 
             // check if on_halt (eg kill)
-            if(THEKERNEL->is_halted()) return;
+            if(THEKERNEL->is_halted()){
+                THEKERNEL->streams->printf("Homing cycle aborted by kill\n");
+                return;
+            }
 
             if(home_all) {
                 // for deltas this may be important rather than setting each individually
index e2bcb99..8b3c0e5 100644 (file)
@@ -330,7 +330,10 @@ 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(THEKERNEL->is_halted() || this->target_temperature == UNDEFINED) break;
+                            if(THEKERNEL->is_halted() || this->target_temperature == UNDEFINED) {
+                                THEKERNEL->streams->printf("Wait on temperature aborted by kill\n");
+                                break;
+                            }
                         }
                         this->waiting = false;
                     }
index 91327b1..d395178 100644 (file)
@@ -135,6 +135,11 @@ bool ZProbe::wait_for_probe(int& steps)
     unsigned int debounce = 0;
     while(true) {
         THEKERNEL->call_event(ON_IDLE);
+        if(THEKERNEL->is_halted()){
+            // aborted by kill
+            return false;
+        }
+
         // if no stepper is moving, moves are finished and there was no touch
         if( !STEPPER[Z_AXIS]->is_moving() && (!is_delta || (!STEPPER[Y_AXIS]->is_moving() && !STEPPER[Z_AXIS]->is_moving())) ) {
             return false;