diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-12-14 18:15:32 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-12-14 18:15:32 +0300 |
commit | 6bb82cf378ae3cada270c4d1933876e6544b3d66 (patch) | |
tree | 1f6fd0908c648349710112a1597498bbed660560 /src/Endstops/StallDetectionEndstop.cpp | |
parent | c91cddf8642f196be5625b3db2e9eb4e15ff3ac2 (diff) |
Reworked stall detection endstops and implemented them for TMC2209
Diffstat (limited to 'src/Endstops/StallDetectionEndstop.cpp')
-rw-r--r-- | src/Endstops/StallDetectionEndstop.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Endstops/StallDetectionEndstop.cpp b/src/Endstops/StallDetectionEndstop.cpp index bc127a5c..89112829 100644 --- a/src/Endstops/StallDetectionEndstop.cpp +++ b/src/Endstops/StallDetectionEndstop.cpp @@ -7,12 +7,14 @@ #include "StallDetectionEndstop.h" +#if HAS_STALL_DETECT + #include "Platform.h" #include "Movement/Kinematics/Kinematics.h" // Stall detection endstop -StallDetectionEndstop::StallDetectionEndstop(uint8_t axis, EndStopPosition pos, bool p_individualMotors) noexcept - : Endstop(axis, pos), individualMotors(p_individualMotors) +StallDetectionEndstop::StallDetectionEndstop(uint8_t p_axis, EndStopPosition pos, bool p_individualMotors) noexcept + : Endstop(p_axis, pos), individualMotors(p_individualMotors) { } @@ -24,7 +26,7 @@ StallDetectionEndstop::StallDetectionEndstop() noexcept // Test whether we are at or near the stop EndStopHit StallDetectionEndstop::Stopped() const noexcept { - return (GetStalledDrivers().Intersects(driversMonitored)) ? EndStopHit::atStop : EndStopHit::noStop; + return (GetStalledDrivers(driversMonitored).IsNonEmpty()) ? EndStopHit::atStop : EndStopHit::noStop; } // This is called to prime axis endstops @@ -47,7 +49,7 @@ bool StallDetectionEndstop::Prime(const Kinematics& kin, const AxisDriversConfig EndstopHitDetails StallDetectionEndstop::CheckTriggered(bool goingSlow) noexcept { EndstopHitDetails rslt; // initialised by default constructor - const DriversBitmap relevantStalledDrivers = driversMonitored & GetStalledDrivers(); + const DriversBitmap relevantStalledDrivers = GetStalledDrivers(driversMonitored); if (relevantStalledDrivers.IsNonEmpty()) { rslt.axis = GetAxis(); @@ -124,4 +126,6 @@ void StallDetectionEndstop::SetDrivers(DriversBitmap extruderDrivers) noexcept stopAll = true; } +#endif + // End |