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
diff options
context:
space:
mode:
Diffstat (limited to 'src/GCodes')
-rw-r--r--src/GCodes/GCodes3.cpp13
-rw-r--r--src/GCodes/GCodes4.cpp5
2 files changed, 13 insertions, 5 deletions
diff --git a/src/GCodes/GCodes3.cpp b/src/GCodes/GCodes3.cpp
index 51db8901..a511b714 100644
--- a/src/GCodes/GCodes3.cpp
+++ b/src/GCodes/GCodes3.cpp
@@ -79,6 +79,10 @@ GCodeResult GCodes::SetPositions(GCodeBuffer& gb, const StringRef& reply) THROWS
axisLettersMentioned.ClearBits(ms.GetOwnedAxisLetters());
if (axisLettersMentioned.IsNonEmpty())
{
+ if (!LockCurrentMovementSystemAndWaitForStandstill(gb)) // lock movement and get current coordinates before we try to allocate any axes
+ {
+ return GCodeResult::notFinished;
+ }
AllocateAxisLetters(gb, ms, axisLettersMentioned);
}
#endif
@@ -91,6 +95,7 @@ GCodeResult GCodes::SetPositions(GCodeBuffer& gb, const StringRef& reply) THROWS
if (gb.Seen(axisLetters[axis]))
{
const float axisValue = gb.GetFValue();
+#if !SUPPORT_ASYNC_MOVES
if (axesIncluded.IsEmpty())
{
if (!LockCurrentMovementSystemAndWaitForStandstill(gb)) // lock movement and get current coordinates
@@ -98,6 +103,7 @@ GCodeResult GCodes::SetPositions(GCodeBuffer& gb, const StringRef& reply) THROWS
return GCodeResult::notFinished;
}
}
+#endif
axesIncluded.SetBit(axis);
ms.currentUserPosition[axis] = gb.ConvertDistance(axisValue);
}
@@ -115,12 +121,12 @@ GCodeResult GCodes::SetPositions(GCodeBuffer& gb, const StringRef& reply) THROWS
if (reprap.GetMove().GetKinematics().LimitPosition(ms.coords, nullptr, numVisibleAxes, axesIncluded, false, limitAxes) != LimitPositionResult::ok)
{
- ToolOffsetInverseTransform(ms); // make sure the limits are reflected in the user position
+ ToolOffsetInverseTransform(ms); // make sure the limits are reflected in the user position
}
- reprap.GetMove().SetNewPosition(ms.coords, true, gb.GetActiveQueueNumber());
#if SUPPORT_ASYNC_MOVES
- ms.SaveOwnAxisCoordinates();
+ ms.OwnedAxisCoordinatesUpdated(axesIncluded); // save coordinates of any owned axes we changed
#endif
+ reprap.GetMove().SetNewPosition(ms.coords, true, gb.GetActiveQueueNumber());
if (!IsSimulating())
{
axesHomed |= reprap.GetMove().GetKinematics().AxesAssumedHomed(axesIncluded);
@@ -131,7 +137,6 @@ GCodeResult GCodes::SetPositions(GCodeBuffer& gb, const StringRef& reply) THROWS
}
reprap.MoveUpdated(); // because we may have updated axesHomed or zDatumSetByProbing
}
-
}
return GCodeResult::ok;
diff --git a/src/GCodes/GCodes4.cpp b/src/GCodes/GCodes4.cpp
index 293bd405..51f06764 100644
--- a/src/GCodes/GCodes4.cpp
+++ b/src/GCodes/GCodes4.cpp
@@ -1120,7 +1120,10 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept
if (tapsDone <= 1 && !hadProbingError)
{
// Reset the Z axis origin according to the height error so that we can move back up to the dive height
- ms.UpdateOwnedAxisCoordinate(Z_AXIS, zp->GetActualTriggerHeight());
+ ms.coords[Z_AXIS] = zp->GetActualTriggerHeight();
+#if SUPPORT_ASYNC_MOVES
+ ms.OwnedAxisCoordinateUpdated(Z_AXIS);
+#endif
reprap.GetMove().SetNewPosition(ms.coords, false, gb.GetActiveQueueNumber());
// Find the coordinates of the Z probe to pass to SetZeroHeightError