Added M31 to toggle Z probe state

M31 with nothing reports the status, M31 S0 = disable, M31 S1 = enable
This commit is contained in:
Tony 2013-11-09 15:45:54 +00:00
parent 07d7433e5d
commit 8718503738

View file

@ -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++)