Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-11-01 21:15:37 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-11-01 21:15:37 +0300
commit63d824642598cbd0f48beb410c137aa38769fb23 (patch)
tree5210b0eed72008551837bc57ca4b9c0a4e86c093
parente9e554aad66542a896ed316f05cc271461a2d4de (diff)
Restrict Z probe types 1,2,3,5 to probe #0
-rw-r--r--src/Endstops/EndstopsManager.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Endstops/EndstopsManager.cpp b/src/Endstops/EndstopsManager.cpp
index 467a9fc2..1f51bcc1 100644
--- a/src/Endstops/EndstopsManager.cpp
+++ b/src/Endstops/EndstopsManager.cpp
@@ -611,10 +611,9 @@ GCodeResult EndstopsManager::HandleM558(GCodeBuffer& gb, const StringRef &reply)
// If it is a motor stall endstop, there should not be a port specified, but we can ignore the port if it is present
uint32_t probeType = (uint32_t)ZProbeType::none;
bool seenType = false;
- gb.TryGetUIValue('P', probeType, seenType);
+ gb.TryGetLimitedUIValue('P', probeType, seenType, (uint32_t)ZProbeType::numTypes);
if ( seenType
- && ( probeType >= (uint32_t)ZProbeType::numTypes
- || probeType == (uint32_t)ZProbeType::e1Switch_obsolete
+ && ( probeType == (uint32_t)ZProbeType::e1Switch_obsolete
|| probeType == (uint32_t)ZProbeType::endstopSwitch_obsolete
|| probeType == (uint32_t)ZProbeType::zSwitch_obsolete
)
@@ -682,6 +681,16 @@ GCodeResult EndstopsManager::HandleM558(GCodeBuffer& gb, const StringRef &reply)
}
else
#endif
+ if ( probeNumber != 0
+ && ( probeType == (unsigned int)ZProbeType::analog || probeType == (unsigned int)ZProbeType::alternateAnalog
+ || probeType == (unsigned int)ZProbeType::dumbModulated || probeType == (unsigned int)ZProbeType::digital
+ )
+ )
+ {
+ reply.copy("Types 1,2,3 and 5 are available for Z probe 0 only");
+ return GCodeResult::error;
+ }
+ else
{
newProbe = new LocalZProbe(probeNumber);
}