From 8718503738733e6627e50ff9d9aedfc18488e4e5 Mon Sep 17 00:00:00 2001 From: Tony Date: Sat, 9 Nov 2013 15:45:54 +0000 Subject: [PATCH] Added M31 to toggle Z probe state M31 with nothing reports the status, M31 S0 = disable, M31 S1 = enable --- GCodes.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GCodes.cpp b/GCodes.cpp index aadfa7c..45448bb 100644 --- a/GCodes.cpp +++ b/GCodes.cpp @@ -744,6 +744,14 @@ bool GCodes::ActOnGcode(GCodeBuffer *gb) fileBeingPrinted = NULL; break; + case 31: //toggle the Z probe enable, M31 with nothing reports the status, M31 S0 = disable, M31 S1 = enable + if(gb->Seen('S')) + platform->EnableZProbe((bool)gb->GetIValue()); + if(platform->IsZProbeEnabled()) + platform->Message(HOST_MESSAGE, "Z Probe enabled \n"); + else + platform->Message(HOST_MESSAGE, "Z Probe disabled \n"); + break; case 82: if(drivesRelative) for(uint8_t i = AXES; i < DRIVES; i++)