diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-03-03 13:52:37 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-03-03 13:52:37 +0300 |
commit | f5b540bdca881d09fac7aecfbf4fefdbe0d48da0 (patch) | |
tree | 40c4c0bb32378ee33e53c251be74d4764d9df350 /src/Endstops/ZProbeEndstop.cpp | |
parent | 7a3045b53e3e303a988ce4565b2ac21206182ffb (diff) |
Got rid of "near endstop" status
Cherry picked from commit 165b178f7de75b1d00b26fec28f2a03fb36d6119
Diffstat (limited to 'src/Endstops/ZProbeEndstop.cpp')
-rw-r--r-- | src/Endstops/ZProbeEndstop.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/Endstops/ZProbeEndstop.cpp b/src/Endstops/ZProbeEndstop.cpp index 1771eceb..bd02d813 100644 --- a/src/Endstops/ZProbeEndstop.cpp +++ b/src/Endstops/ZProbeEndstop.cpp @@ -18,10 +18,10 @@ ZProbeEndstop::ZProbeEndstop(uint8_t p_axis, EndStopPosition pos) noexcept : End } // Test whether we are at or near the stop -EndStopHit ZProbeEndstop::Stopped() const noexcept +bool ZProbeEndstop::Stopped() const noexcept { const auto zp = reprap.GetPlatform().GetEndstops().GetZProbe(zProbeNumber); - return (zp.IsNotNull()) ? zp->Stopped() : EndStopHit::atStop; + return zp.IsNotNull() && zp->Stopped(); } // This is called to prime axis endstops @@ -41,9 +41,8 @@ bool ZProbeEndstop::Prime(const Kinematics& kin, const AxisDriversConfig& axisDr EndstopHitDetails ZProbeEndstop::CheckTriggered(bool goingSlow) noexcept { EndstopHitDetails rslt; // initialised by default constructor - switch (Stopped()) + if (Stopped()) { - case EndStopHit::atStop: rslt.SetAction((stopAll) ? EndstopHitAction::stopAll : EndstopHitAction::stopAxis); rslt.axis = GetAxis(); if (GetAtHighEnd()) @@ -54,17 +53,6 @@ EndstopHitDetails ZProbeEndstop::CheckTriggered(bool goingSlow) noexcept { rslt.setAxisLow = true; } - break; - - case EndStopHit::nearStop: - if (!goingSlow) - { - rslt.SetAction(EndstopHitAction::reduceSpeed); - } - break; - - default: - break; } return rslt; } @@ -73,7 +61,7 @@ EndstopHitDetails ZProbeEndstop::CheckTriggered(bool goingSlow) noexcept // Return true if we have finished with this endstop or probe in this move. bool ZProbeEndstop::Acknowledge(EndstopHitDetails what) noexcept { - return what.GetAction() != EndstopHitAction::reduceSpeed; + return true; } void ZProbeEndstop::AppendDetails(const StringRef& str) noexcept |