diff options
author | David Crocker <dcrocker@eschertech.com> | 2019-11-08 21:14:36 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2019-11-08 21:14:36 +0300 |
commit | 68fa1e12e6d45507ecb5f8f075a1e608f3508e3f (patch) | |
tree | 65870dd0b5ac7f142f5b4db3f59c0356aad0a40d /src/Endstops/StallDetectionEndstop.cpp | |
parent | 255319723a2c44dc23abe9ddb0f5eeb0e1e48892 (diff) |
Added check when using remote endstops
When setting up G1 H1 or G1 H3 moves that rely on remote endstops, check that the expansion board knows about the
Fixed build errors that occurred in some configurations
Diffstat (limited to 'src/Endstops/StallDetectionEndstop.cpp')
-rw-r--r-- | src/Endstops/StallDetectionEndstop.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Endstops/StallDetectionEndstop.cpp b/src/Endstops/StallDetectionEndstop.cpp index 0c888775..6a566572 100644 --- a/src/Endstops/StallDetectionEndstop.cpp +++ b/src/Endstops/StallDetectionEndstop.cpp @@ -23,13 +23,18 @@ EndStopHit StallDetectionEndstop::Stopped() const } // This is called to prime axis endstops -void StallDetectionEndstop::Prime(const Kinematics& kin, const AxisDriversConfig& axisDrivers) +bool StallDetectionEndstop::Prime(const Kinematics& kin, const AxisDriversConfig& axisDrivers) { - // Find which drivers are relevant, Decide whether we stop just the driver, just the axis, or everything - // Decide whether we stop just the driver, just the axis, or everything + // Find which drivers are relevant, and decide whether we stop just the driver, just the axis, or everything stopAll = (kin.GetConnectedAxes(GetAxis()) & ~MakeBitmap<AxesBitmap>(GetAxis())) != 0; numDriversLeft = axisDrivers.numDrivers; driversMonitored = axisDrivers.GetDriversBitmap(); + +#if SUPPORT_CAN_EXPANSION + //TODO if there any remote stall endstops, check they are set up to report +#endif + + return true; } // Check whether the endstop is triggered and return the action that should be performed. Called from the step ISR. @@ -37,7 +42,7 @@ void StallDetectionEndstop::Prime(const Kinematics& kin, const AxisDriversConfig EndstopHitDetails StallDetectionEndstop::CheckTriggered(bool goingSlow) { EndstopHitDetails rslt; // initialised by default constructor - DriversBitmap relevantStalledDrivers = driversMonitored && GetStalledDrivers(); + const DriversBitmap relevantStalledDrivers = driversMonitored & GetStalledDrivers(); if (relevantStalledDrivers != 0) { rslt.axis = GetAxis(); |