M503 will inform user if bed plane will be saved
authorJim Morris <morris@wolfman.com>
Mon, 4 Aug 2014 00:24:57 +0000 (17:24 -0700)
committerJim Morris <morris@wolfman.com>
Mon, 4 Aug 2014 00:24:57 +0000 (17:24 -0700)
src/modules/tools/zprobe/ThreePointStrategy.cpp

index 5ca4ddf..be8a2c6 100644 (file)
@@ -188,10 +188,14 @@ bool ThreePointStrategy::handleGcode(Gcode *gcode)
             gcode->stream->printf("M565 X%1.5f Y%1.5f Z%1.5f\n", x, y, z);
 
             // encode plane and save if set and M500 and enabled
-            if(this->save && this->plane != nullptr && gcode->m == 500) {
-                uint32_t a, b, c, d;
-                this->plane->encode(a, b, c, d);
-                gcode->stream->printf(";Saved bed plane:\nM561 A%lu B%lu C%lu D%lu \n", a, b, c, d);
+            if(this->save && this->plane != nullptr) {
+                if(gcode->m == 500) {
+                    uint32_t a, b, c, d;
+                    this->plane->encode(a, b, c, d);
+                    gcode->stream->printf(";Saved bed plane:\nM561 A%lu B%lu C%lu D%lu \n", a, b, c, d);
+                }else{
+                    gcode->stream->printf(";The bed plane will be saved on M500\n");
+                }
             }
             return true;