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:
authorDavid Crocker <dcrocker@eschertech.com>2022-11-05 14:20:21 +0300
committerDavid Crocker <dcrocker@eschertech.com>2022-11-05 14:20:21 +0300
commit90e701a8f7ef911138849b9daf65d20612396de0 (patch)
treea6a4e9b7f5b87b15f666621e1ebd2024febdc2d9
parentd7132cf2a6d7d184ea4ffea1107eb84a716ecaf4 (diff)
Fixed tool change issue
-rw-r--r--src/GCodes/GCodeException.cpp2
-rw-r--r--src/GCodes/GCodes.cpp6
-rw-r--r--src/GCodes/GCodes4.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/GCodes/GCodeException.cpp b/src/GCodes/GCodeException.cpp
index 9789ac52..7a3d7c56 100644
--- a/src/GCodes/GCodeException.cpp
+++ b/src/GCodes/GCodeException.cpp
@@ -62,7 +62,7 @@ void GCodeException::GetMessage(const StringRef &reply, const GCodeBuffer *null
{
reply.catf(message, stringParam.c_str());
}
- else if (strstr(message, "%u"))
+ else if (strstr(message, "%u") || strstr(message, "%c"))
{
reply.catf(message, param.u);
}
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp
index ccfd4ac2..90812def 100644
--- a/src/GCodes/GCodes.cpp
+++ b/src/GCodes/GCodes.cpp
@@ -4963,10 +4963,10 @@ const MovementState& GCodes::GetCurrentMovementState(const ObjectExplorationCont
// This relies on cooperative scheduling between different GCodeBuffer objects
void GCodes::AllocateAxes(const GCodeBuffer& gb, MovementState& ms, AxesBitmap axes, ParameterLettersBitmap axLetters) THROWS(GCodeException)
{
- if (!ms.AllocateAxes(axes, axLetters).IsEmpty())
+ const AxesBitmap badAxes = ms.AllocateAxes(axes, axLetters);
+ if (!badAxes.IsEmpty())
{
- //TODO report the lowest axis letter that is already allocated
- gb.ThrowGCodeException("Axis is already used by a different motion system");
+ gb.ThrowGCodeException("Axis %c is already used by a different motion system", (unsigned int)axisLetters[badAxes.LowestSetBit()]);
}
UpdateUserPositionFromMachinePosition(gb, ms);
}
diff --git a/src/GCodes/GCodes4.cpp b/src/GCodes/GCodes4.cpp
index 1c69eff4..401f6333 100644
--- a/src/GCodes/GCodes4.cpp
+++ b/src/GCodes/GCodes4.cpp
@@ -367,6 +367,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept
#if SUPPORT_ASYNC_MOVES && PREALLOCATE_TOOL_AXES
// Whenever we release axes, we must update lastKnownMachinePositions for those axes first so that whoever allocated them next gets the correct positions
ms.SaveOwnAxisCoordinates();
+ gb.AdvanceState();
ReadLockedPointer<Tool> newTool = Tool::GetLockedTool(ms.newToolNumber);
if (newTool.IsNull())
@@ -406,7 +407,6 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept
DoFileMacro(gb, scratchString.c_str(), false, ToolChangeMacroCode);
}
}
- gb.AdvanceState();
}
break;