diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-01-04 20:06:52 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-01-04 20:06:52 +0300 |
commit | 8343f55a7e9364fe1c585feb4da4355ba516728c (patch) | |
tree | 24a7ca8a01cb9c8dff33ca34de0101715b74222d /src/CAN | |
parent | c074dfa61dbfae697d9551fa5cd3ec7a61582ae3 (diff) |
Fixes for ATE and expansion mode
Set up correct CAN master address in ATE builds
Implemented M569 in expansion mode
Diffstat (limited to 'src/CAN')
-rw-r--r-- | src/CAN/CanInterface.cpp | 2 | ||||
-rw-r--r-- | src/CAN/CanMessageGenericConstructor.cpp | 13 | ||||
-rw-r--r-- | src/CAN/CanMessageGenericConstructor.h | 1 | ||||
-rw-r--r-- | src/CAN/CommandProcessor.cpp | 5 |
4 files changed, 19 insertions, 2 deletions
diff --git a/src/CAN/CanInterface.cpp b/src/CAN/CanInterface.cpp index 6fda53b9..7092cad6 100644 --- a/src/CAN/CanInterface.cpp +++ b/src/CAN/CanInterface.cpp @@ -62,7 +62,7 @@ static uint32_t longestWaitTime = 0; static uint16_t longestWaitMessageType = 0; static CanAddress myAddress = -#ifdef DUET3ATE +#ifdef DUET3_ATE CanId::ATEMasterAddress; #else CanId::MasterAddress; diff --git a/src/CAN/CanMessageGenericConstructor.cpp b/src/CAN/CanMessageGenericConstructor.cpp index a384c8af..72fd7e26 100644 --- a/src/CAN/CanMessageGenericConstructor.cpp +++ b/src/CAN/CanMessageGenericConstructor.cpp @@ -270,7 +270,6 @@ void CanMessageGenericConstructor::AddIParam(char c, int32_t v) THROWS(GCodeExce default: throw ConstructParseException("ival wrong parameter type"); - return; } InsertValue(&v, sz, pos); @@ -317,6 +316,18 @@ void CanMessageGenericConstructor::AddStringParam(char c, const char *v) THROWS( } } +void CanMessageGenericConstructor::AddDriverIdParam(char c, DriverId did) THROWS(GCodeException) +{ + ParamDescriptor::ParamType t; + size_t sz; + const unsigned int pos = FindInsertPoint(c, t, sz); + if (t != ParamDescriptor::localDriver) + { + throw ConstructParseException("didval wrong parameter type"); + } + + InsertValue(&did.localDriver, sz, pos); +} GCodeResult CanMessageGenericConstructor::SendAndGetResponse(CanMessageType msgType, CanAddress dest, const StringRef& reply) noexcept { diff --git a/src/CAN/CanMessageGenericConstructor.h b/src/CAN/CanMessageGenericConstructor.h index c252c637..50969ce7 100644 --- a/src/CAN/CanMessageGenericConstructor.h +++ b/src/CAN/CanMessageGenericConstructor.h @@ -33,6 +33,7 @@ public: void AddFParam(char c, float v) THROWS(GCodeException); void AddCharParam(char c, char v) THROWS(GCodeException); void AddStringParam(char c, const char* v) THROWS(GCodeException); + void AddDriverIdParam(char c, DriverId did) THROWS(GCodeException); GCodeResult SendAndGetResponse(CanMessageType msgType, CanAddress dest, const StringRef& reply) noexcept; diff --git a/src/CAN/CommandProcessor.cpp b/src/CAN/CommandProcessor.cpp index 212d8fcf..23ef0162 100644 --- a/src/CAN/CommandProcessor.cpp +++ b/src/CAN/CommandProcessor.cpp @@ -443,6 +443,11 @@ void CommandProcessor::ProcessReceivedMessage(CanMessageBuffer *buf) noexcept rslt = reprap.GetPlatform().EutSetRemotePressureAdvance(buf->msg.multipleDrivesRequestFloat, buf->dataLength, replyRef); break; + case CanMessageType::m569: + requestId = buf->msg.generic.requestId; + rslt = reprap.GetPlatform().EutProcessM569(buf->msg.generic, replyRef); + break; + case CanMessageType::createInputMonitor: requestId = buf->msg.createInputMonitor.requestId; rslt = InputMonitor::Create(buf->msg.createInputMonitor, buf->dataLength, replyRef, extra); |