diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-03-12 19:26:58 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-03-12 19:26:58 +0300 |
commit | 2c74f0e033d7194013d3a3a0818660051f5cf148 (patch) | |
tree | a29eff1b9c41a1e84c8a27cc2c9565b4cb6aafe9 /src/Endstops | |
parent | 6052f634c26fffe37b25fade21f138acdecc36f4 (diff) |
Rewrote M675 to fix numerous issues
M675 didn't deploy/retract probe or turn off heaters if configured
M675 had no error handling for probe aready triggered/not triggered
M675 didn't work consistently
M675 now accepts parameter K in place of P and requires either K or P
Also changed DeployZProbe to default to deployprobe.g only if
deployprobe0.g is not found, not for other Z probes. Similarly for
retractprobe.g.
Refactored code to set axis lengths mafter a G1 H3 move
Moved StraightProbeSettings from the Move module (which didn't use them)
to GCodes
Removed unused goingSlow parameter from endstop CheckTriggered functions
Diffstat (limited to 'src/Endstops')
-rw-r--r-- | src/Endstops/Endstop.h | 2 | ||||
-rw-r--r-- | src/Endstops/EndstopsManager.cpp | 4 | ||||
-rw-r--r-- | src/Endstops/EndstopsManager.h | 2 | ||||
-rw-r--r-- | src/Endstops/StallDetectionEndstop.cpp | 2 | ||||
-rw-r--r-- | src/Endstops/StallDetectionEndstop.h | 2 | ||||
-rw-r--r-- | src/Endstops/SwitchEndstop.cpp | 2 | ||||
-rw-r--r-- | src/Endstops/SwitchEndstop.h | 2 | ||||
-rw-r--r-- | src/Endstops/ZProbe.cpp | 2 | ||||
-rw-r--r-- | src/Endstops/ZProbe.h | 2 | ||||
-rw-r--r-- | src/Endstops/ZProbeEndstop.cpp | 2 | ||||
-rw-r--r-- | src/Endstops/ZProbeEndstop.h | 2 |
11 files changed, 12 insertions, 12 deletions
diff --git a/src/Endstops/Endstop.h b/src/Endstops/Endstop.h index 0bdc7649..cbdcf15e 100644 --- a/src/Endstops/Endstop.h +++ b/src/Endstops/Endstop.h @@ -30,7 +30,7 @@ public: virtual ~EndstopOrZProbe() noexcept {} virtual bool Stopped() const noexcept = 0; - virtual EndstopHitDetails CheckTriggered(bool goingSlow) noexcept = 0; + virtual EndstopHitDetails CheckTriggered() noexcept = 0; virtual bool Acknowledge(EndstopHitDetails what) noexcept = 0; EndstopOrZProbe *GetNext() const noexcept { return next; } diff --git a/src/Endstops/EndstopsManager.cpp b/src/Endstops/EndstopsManager.cpp index f010711d..dfe28b52 100644 --- a/src/Endstops/EndstopsManager.cpp +++ b/src/Endstops/EndstopsManager.cpp @@ -256,13 +256,13 @@ bool EndstopsManager::EnableExtruderEndstops(ExtrudersBitmap extruders) noexcept // Check the endstops. // If an endstop has triggered, remove it from the active list and return its details -EndstopHitDetails EndstopsManager::CheckEndstops(bool goingSlow) noexcept +EndstopHitDetails EndstopsManager::CheckEndstops() noexcept { EndstopHitDetails ret; // the default constructor will clear all fields EndstopOrZProbe *actioned = nullptr; for (EndstopOrZProbe *esp = activeEndstops; esp != nullptr; esp = esp->GetNext()) { - EndstopHitDetails hd = esp->CheckTriggered(goingSlow); + EndstopHitDetails hd = esp->CheckTriggered(); if (hd.GetAction() == EndstopHitAction::stopAll) { activeEndstops = nullptr; // no need to do anything else diff --git a/src/Endstops/EndstopsManager.h b/src/Endstops/EndstopsManager.h index c3ce99a8..52e7b903 100644 --- a/src/Endstops/EndstopsManager.h +++ b/src/Endstops/EndstopsManager.h @@ -40,7 +40,7 @@ public: bool EnableExtruderEndstops(ExtrudersBitmap extruders) noexcept; // Get the first endstop that has triggered and remove it from the active list if appropriate - EndstopHitDetails CheckEndstops(bool goingSlow) noexcept; + EndstopHitDetails CheckEndstops() noexcept; // Configure the endstops in response to M574 GCodeResult HandleM574(GCodeBuffer& gb, const StringRef& reply, OutputBuffer*& outbuf) noexcept; diff --git a/src/Endstops/StallDetectionEndstop.cpp b/src/Endstops/StallDetectionEndstop.cpp index 194aa42b..65be4b45 100644 --- a/src/Endstops/StallDetectionEndstop.cpp +++ b/src/Endstops/StallDetectionEndstop.cpp @@ -46,7 +46,7 @@ bool StallDetectionEndstop::Prime(const Kinematics& kin, const AxisDriversConfig // Check whether the endstop is triggered and return the action that should be performed. Called from the step ISR. // Note, the result will not necessarily be acted on because there may be a higher priority endstop! -EndstopHitDetails StallDetectionEndstop::CheckTriggered(bool goingSlow) noexcept +EndstopHitDetails StallDetectionEndstop::CheckTriggered() noexcept { EndstopHitDetails rslt; // initialised by default constructor const DriversBitmap relevantStalledDrivers = GetStalledDrivers(driversMonitored); diff --git a/src/Endstops/StallDetectionEndstop.h b/src/Endstops/StallDetectionEndstop.h index 4765ce7c..4bcacf6b 100644 --- a/src/Endstops/StallDetectionEndstop.h +++ b/src/Endstops/StallDetectionEndstop.h @@ -25,7 +25,7 @@ public: EndStopType GetEndstopType() const noexcept override { return (individualMotors) ? EndStopType::motorStallIndividual : EndStopType::motorStallAny; } bool Stopped() const noexcept override; bool Prime(const Kinematics& kin, const AxisDriversConfig& axisDrivers) noexcept override; - EndstopHitDetails CheckTriggered(bool goingSlow) noexcept override; + EndstopHitDetails CheckTriggered() noexcept override; bool Acknowledge(EndstopHitDetails what) noexcept override; void AppendDetails(const StringRef& str) noexcept override; void SetDrivers(DriversBitmap extruderDrivers) noexcept; // for setting which local extruder drives are active extruder endstops diff --git a/src/Endstops/SwitchEndstop.cpp b/src/Endstops/SwitchEndstop.cpp index 655c4eb9..8a30f9ec 100644 --- a/src/Endstops/SwitchEndstop.cpp +++ b/src/Endstops/SwitchEndstop.cpp @@ -161,7 +161,7 @@ bool SwitchEndstop::Prime(const Kinematics& kin, const AxisDriversConfig& axisDr // Check whether the endstop is triggered and return the action that should be performed. Don't update the state until Acknowledge is called. // Called from the step ISR. -EndstopHitDetails SwitchEndstop::CheckTriggered(bool goingSlow) noexcept +EndstopHitDetails SwitchEndstop::CheckTriggered() noexcept { EndstopHitDetails rslt; // initialised by default constructor if (portsLeftToTrigger.IsNonEmpty()) diff --git a/src/Endstops/SwitchEndstop.h b/src/Endstops/SwitchEndstop.h index ae35ca50..7278f601 100644 --- a/src/Endstops/SwitchEndstop.h +++ b/src/Endstops/SwitchEndstop.h @@ -24,7 +24,7 @@ public: EndStopType GetEndstopType() const noexcept override; bool Stopped() const noexcept override; bool Prime(const Kinematics& kin, const AxisDriversConfig& axisDrivers) noexcept override; - EndstopHitDetails CheckTriggered(bool goingSlow) noexcept override; + EndstopHitDetails CheckTriggered() noexcept override; bool Acknowledge(EndstopHitDetails what) noexcept override; void AppendDetails(const StringRef& str) noexcept override; diff --git a/src/Endstops/ZProbe.cpp b/src/Endstops/ZProbe.cpp index b1c5760f..c9693168 100644 --- a/src/Endstops/ZProbe.cpp +++ b/src/Endstops/ZProbe.cpp @@ -224,7 +224,7 @@ bool ZProbe::Stopped() const noexcept } // Check whether the probe is triggered and return the action that should be performed. Called from the step ISR. -EndstopHitDetails ZProbe::CheckTriggered(bool goingSlow) noexcept +EndstopHitDetails ZProbe::CheckTriggered() noexcept { bool b = Stopped(); if (misc.parts.probingAway) diff --git a/src/Endstops/ZProbe.h b/src/Endstops/ZProbe.h index d1a0df38..fecf23fe 100644 --- a/src/Endstops/ZProbe.h +++ b/src/Endstops/ZProbe.h @@ -29,7 +29,7 @@ public: #endif bool Stopped() const noexcept override; - EndstopHitDetails CheckTriggered(bool goingSlow) noexcept override; + EndstopHitDetails CheckTriggered() noexcept override; bool Acknowledge(EndstopHitDetails what) noexcept override; void SetDefaults() noexcept; diff --git a/src/Endstops/ZProbeEndstop.cpp b/src/Endstops/ZProbeEndstop.cpp index 816f6e3b..9e686e98 100644 --- a/src/Endstops/ZProbeEndstop.cpp +++ b/src/Endstops/ZProbeEndstop.cpp @@ -38,7 +38,7 @@ bool ZProbeEndstop::Prime(const Kinematics& kin, const AxisDriversConfig& axisDr } // Check whether the endstop is triggered and return the action that should be performed. Called from the step ISR. -EndstopHitDetails ZProbeEndstop::CheckTriggered(bool goingSlow) noexcept +EndstopHitDetails ZProbeEndstop::CheckTriggered() noexcept { EndstopHitDetails rslt; // initialised by default constructor if (Stopped()) diff --git a/src/Endstops/ZProbeEndstop.h b/src/Endstops/ZProbeEndstop.h index f31778fe..3a1db7a2 100644 --- a/src/Endstops/ZProbeEndstop.h +++ b/src/Endstops/ZProbeEndstop.h @@ -21,7 +21,7 @@ public: EndStopType GetEndstopType() const noexcept override { return EndStopType::zProbeAsEndstop; } bool Stopped() const noexcept override; bool Prime(const Kinematics& kin, const AxisDriversConfig& axisDrivers) noexcept override; - EndstopHitDetails CheckTriggered(bool goingSlow) noexcept override; + EndstopHitDetails CheckTriggered() noexcept override; bool Acknowledge(EndstopHitDetails what) noexcept override; void AppendDetails(const StringRef& str) noexcept override; |