Remove condition and set invet_probe to false for all G38 gcodes-- it's already set...
authorJames Richters <james@productionautomation.net>
Mon, 23 Apr 2018 16:49:29 +0000 (12:49 -0400)
committerJames Richters <james@productionautomation.net>
Mon, 23 Apr 2018 16:49:29 +0000 (12:49 -0400)
src/modules/tools/zprobe/ZProbe.cpp

index 864ab06..3ef6d38 100644 (file)
@@ -326,6 +326,7 @@ void ZProbe::on_gcode_received(void *argument)
 
     } else if(gcode->has_g && gcode->g == 38 ) { // G38.2 Straight Probe with error, G38.3 straight probe without error
         // linuxcnc/grbl style probe http://www.linuxcnc.org/docs/2.5/html/gcode/gcode.html#sec:G38-probe
+        invert_probe = false;
         if(gcode->subcode < 2 || gcode->subcode > 5) {
             gcode->stream->printf("error:Only G38.2 to G38.5 are supported\n");
             return;
@@ -369,10 +370,6 @@ void ZProbe::on_gcode_received(void *argument)
 
         probe_XYZ(gcode, x, y, z);
 
-        if(gcode->subcode == 4 || gcode->subcode == 5) {
-            invert_probe = false;
-        }
-
         return;
 
     } else if(gcode->has_m) {