Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2022-01-28 18:59:45 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-01-28 18:59:45 +0300
commite9aa909cd187d122e4f8ac207ecca3e2fce959d9 (patch)
treec591e887e8750539645d39c9c905e489f7b2e966 /src
parent2612bab24910fe228e278718f009502b5754f69c (diff)
Expansion mode fixes from gloomyAndy
Diffstat (limited to 'src')
-rw-r--r--src/CAN/CommandProcessor.cpp43
-rw-r--r--src/CAN/ExpansionManager.cpp4
-rw-r--r--src/Movement/DDA.cpp2
3 files changed, 27 insertions, 22 deletions
diff --git a/src/CAN/CommandProcessor.cpp b/src/CAN/CommandProcessor.cpp
index b74c4750..f7223b32 100644
--- a/src/CAN/CommandProcessor.cpp
+++ b/src/CAN/CommandProcessor.cpp
@@ -575,30 +575,33 @@ void CommandProcessor::ProcessReceivedMessage(CanMessageBuffer *buf) noexcept
rslt = GCodeResult::error;
}
- // Re-use the message buffer to send a standard reply
- const CanAddress srcAddress = buf->id.Src();
- CanMessageStandardReply *msg = buf->SetupResponseMessage<CanMessageStandardReply>(requestId, CanInterface::GetCanAddress(), srcAddress);
- msg->resultCode = (uint16_t)rslt;
- msg->extra = extra;
- const size_t totalLength = reply.strlen();
- size_t lengthDone = 0;
- uint8_t fragmentNumber = 0;
- for (;;)
+ if (requestId != CanRequestIdNoReplyNeeded) // if a reply is needed
{
- const size_t fragmentLength = min<size_t>(totalLength - lengthDone, CanMessageStandardReply::MaxTextLength);
- memcpy(msg->text, reply.c_str() + lengthDone, fragmentLength);
- lengthDone += fragmentLength;
- buf->dataLength = msg->GetActualDataLength(fragmentLength);
- msg->fragmentNumber = fragmentNumber;
- if (lengthDone == totalLength)
+ // Re-use the message buffer to send a standard reply
+ const CanAddress srcAddress = buf->id.Src();
+ CanMessageStandardReply *msg = buf->SetupResponseMessage<CanMessageStandardReply>(requestId, CanInterface::GetCanAddress(), srcAddress);
+ msg->resultCode = (uint16_t)rslt;
+ msg->extra = extra;
+ const size_t totalLength = reply.strlen();
+ size_t lengthDone = 0;
+ uint8_t fragmentNumber = 0;
+ for (;;)
{
- msg->moreFollows = false;
+ const size_t fragmentLength = min<size_t>(totalLength - lengthDone, CanMessageStandardReply::MaxTextLength);
+ memcpy(msg->text, reply.c_str() + lengthDone, fragmentLength);
+ lengthDone += fragmentLength;
+ buf->dataLength = msg->GetActualDataLength(fragmentLength);
+ msg->fragmentNumber = fragmentNumber;
+ if (lengthDone == totalLength)
+ {
+ msg->moreFollows = false;
+ CanInterface::SendResponseNoFree(buf);
+ break;
+ }
+ msg->moreFollows = true;
CanInterface::SendResponseNoFree(buf);
- break;
+ ++fragmentNumber;
}
- msg->moreFollows = true;
- CanInterface::SendResponseNoFree(buf);
- ++fragmentNumber;
}
}
else
diff --git a/src/CAN/ExpansionManager.cpp b/src/CAN/ExpansionManager.cpp
index 546e517a..9952e5b2 100644
--- a/src/CAN/ExpansionManager.cpp
+++ b/src/CAN/ExpansionManager.cpp
@@ -173,8 +173,8 @@ void ExpansionManager::ProcessAnnouncement(CanMessageBuffer *buf, bool isNewForm
UpdateBoardState(src, BoardState::running);
// Tell the sending board that we don't need any more announcements from it
- buf->SetupResponseMessage<CanMessageAcknowledgeAnnounce>(0, CanInterface::GetCanAddress(), src);
- CanInterface::SendResponseNoFree(buf);
+ buf->SetupRequestMessage<CanMessageAcknowledgeAnnounce>(0, CanInterface::GetCanAddress(), src);
+ CanInterface::SendMessageNoReplyNoFree(buf);
}
}
diff --git a/src/Movement/DDA.cpp b/src/Movement/DDA.cpp
index 74c4a05f..e98c7042 100644
--- a/src/Movement/DDA.cpp
+++ b/src/Movement/DDA.cpp
@@ -718,6 +718,8 @@ bool DDA::InitFromRemote(const CanMessageMovementLinear& msg) noexcept
params.unshaped.accelClocks = msg.accelerationClocks;
params.unshaped.steadyClocks = msg.steadyClocks;
params.unshaped.decelClocks = msg.decelClocks;
+ params.unshaped.acceleration = acceleration;
+ params.unshaped.deceleration = deceleration;
shapedSegments = unshapedSegments = nullptr;
activeDMs = completedDMs = nullptr;