diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-08-22 11:24:23 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-08-22 11:24:23 +0300 |
commit | 4a94d6063fabc4f0f6e3466555041b3da1390499 (patch) | |
tree | 5d2866ec7414f6e4e6b66a8e9b98fec8f1358352 /src/CAN | |
parent | 65510a271617119f47395e28b8ba42740776e66e (diff) |
Added check on brake port board number
Diffstat (limited to 'src/CAN')
-rw-r--r-- | src/CAN/CanInterface.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/CAN/CanInterface.cpp b/src/CAN/CanInterface.cpp index 410f6580..b82de902 100644 --- a/src/CAN/CanInterface.cpp +++ b/src/CAN/CanInterface.cpp @@ -931,6 +931,17 @@ pre(driver.IsRemote()) } case 7: + if (gb.Seen('C')) + { + // If a port name if provided, it must match the board ID + String<StringLength20> portName; + gb.GetQuotedString(portName.GetRef(), false); + if (isdigit(portName[0]) && IoPort::RemoveBoardAddress(portName.GetRef()) != driver.boardAddress) + { + reply.copy("Brake port must be on same board as driver"); + return GCodeResult::error; + } + } { CanMessageGenericConstructor cons(M569Point7Params); cons.PopulateFromCommand(gb); |