diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-12-28 14:23:52 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-12-28 14:23:52 +0300 |
commit | 44f3b93ddec110ecde6d5b5f8c32cdd8f4cfea22 (patch) | |
tree | 82eb659348214ef8228526d45e54d3016bf51b9b /src/Endstops | |
parent | f6b6be2b85b4cf83a366ffe56de89a1cbdc2a2de (diff) |
Partially implemented M954
Diffstat (limited to 'src/Endstops')
-rw-r--r-- | src/Endstops/EndstopsManager.cpp | 4 | ||||
-rw-r--r-- | src/Endstops/SwitchEndstop.cpp | 6 | ||||
-rw-r--r-- | src/Endstops/SwitchEndstop.h | 3 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/Endstops/EndstopsManager.cpp b/src/Endstops/EndstopsManager.cpp index 4639f681..e8104eef 100644 --- a/src/Endstops/EndstopsManager.cpp +++ b/src/Endstops/EndstopsManager.cpp @@ -25,7 +25,7 @@ #include <Heating/Sensors/TemperatureSensor.h> #if SUPPORT_CAN_EXPANSION -# include "CanMessageBuffer.h" +# include <CanMessageBuffer.h> #endif ReadWriteLock EndstopsManager::endstopsLock; @@ -680,7 +680,7 @@ GCodeResult EndstopsManager::HandleM558(GCodeBuffer& gb, const StringRef &reply) gb.Seen('C'); gb.GetReducedString(pinNames.GetRef()); const CanAddress boardAddress = IoPort::RemoveBoardAddress(pinNames.GetRef()); - if (boardAddress != CanId::MasterAddress) + if (boardAddress != CanInterface::GetCanAddress()) { RemoteZProbe *newRemoteProbe = new RemoteZProbe(probeNumber, boardAddress, (ZProbeType)probeType); const GCodeResult rslt = newRemoteProbe->Create(pinNames.GetRef(), reply); diff --git a/src/Endstops/SwitchEndstop.cpp b/src/Endstops/SwitchEndstop.cpp index b3464d74..d1615a9a 100644 --- a/src/Endstops/SwitchEndstop.cpp +++ b/src/Endstops/SwitchEndstop.cpp @@ -38,7 +38,7 @@ void SwitchEndstop::ReleasePorts() noexcept --numPortsUsed; #if SUPPORT_CAN_EXPANSION const CanAddress bn = boardNumbers[numPortsUsed]; - if (bn != CanId::MasterAddress) + if (bn != CanInterface::GetCanAddress()) { RemoteInputHandle h(RemoteInputHandle::typeEndstop, GetAxis(), numPortsUsed); String<StringLength100> reply; @@ -81,7 +81,7 @@ GCodeResult SwitchEndstop::Configure(const char *pinNames, const StringRef& repl #if SUPPORT_CAN_EXPANSION const CanAddress boardAddress = IoPort::RemoveBoardAddress(pn.GetRef()); boardNumbers[numPortsUsed] = boardAddress; - if (boardAddress != CanId::MasterAddress) + if (boardAddress != CanInterface::GetCanAddress()) { RemoteInputHandle h(RemoteInputHandle::typeEndstop, GetAxis(), numPortsUsed); const GCodeResult rslt = CanInterface::CreateHandle(boardAddress, h, pn.c_str(), 0, MinimumSwitchReportInterval, states[numPortsUsed], reply); @@ -237,7 +237,7 @@ void SwitchEndstop::AppendDetails(const StringRef& str) noexcept { str.cat(' '); #if SUPPORT_CAN_EXPANSION - if (boardNumbers[i] != CanId::MasterAddress) + if (boardNumbers[i] != CanInterface::GetCanAddress()) { RemoteInputHandle h(RemoteInputHandle::typeEndstop, GetAxis(), i); String<StringLength100> reply; diff --git a/src/Endstops/SwitchEndstop.h b/src/Endstops/SwitchEndstop.h index a4f33da6..75117daf 100644 --- a/src/Endstops/SwitchEndstop.h +++ b/src/Endstops/SwitchEndstop.h @@ -9,7 +9,6 @@ #define SRC_ENDSTOPS_SWITCHENDSTOP_H_ #include "Endstop.h" - #include "GCodes/GCodeResult.h" // Switch-type endstop, either on the main board or on a CAN-connected board @@ -45,7 +44,7 @@ private: inline bool IsTriggered(size_t index) const noexcept { #if SUPPORT_CAN_EXPANSION - return (boardNumbers[index] == CanId::MasterAddress) ? ports[index].ReadDigital() : states[index]; + return (boardNumbers[index] == CanInterface::GetCanAddress()) ? ports[index].ReadDigital() : states[index]; #else return ports[index].ReadDigital(); #endif |