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>2021-01-03 13:14:54 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-01-03 13:14:54 +0300
commite90e8710cf470bab54f47c95ae7b8220194804e0 (patch)
tree74f9f913e474f2964cd48f5b09009163b4b92071 /src/GCodes/GCodeBuffer/StringParser.cpp
parent828c84cc9dbe7e8eeed979dacb951c76a82c3178 (diff)
Various
Don't recognise 'G as starting a new command When in expansion mode and a command to set microstepping is received, store the new microstepping locally as well as setting it Implemented M17 Don't look for daemon.g when in expansion mode
Diffstat (limited to 'src/GCodes/GCodeBuffer/StringParser.cpp')
-rw-r--r--src/GCodes/GCodeBuffer/StringParser.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/GCodes/GCodeBuffer/StringParser.cpp b/src/GCodes/GCodeBuffer/StringParser.cpp
index 82536daa..7502668f 100644
--- a/src/GCodes/GCodeBuffer/StringParser.cpp
+++ b/src/GCodes/GCodeBuffer/StringParser.cpp
@@ -749,7 +749,7 @@ void StringParser::DecodeCommand() noexcept
}
}
- // Find where the end of the command is. We assume that a G or M not inside quotes or { } is the start of a new command.
+ // Find where the end of the command is. We assume that a G or M not inside quotes or { } and not preceded by ' is the start of a new command.
bool inQuotes = false;
unsigned int localBraceCount = 0;
for (commandEnd = parameterStart; commandEnd < gcodeLineEnd; ++commandEnd)
@@ -761,7 +761,6 @@ void StringParser::DecodeCommand() noexcept
}
else if (!inQuotes)
{
- char c2;
if (c == '{')
{
++localBraceCount;
@@ -773,9 +772,13 @@ void StringParser::DecodeCommand() noexcept
--localBraceCount;
}
}
- else if ((c2 = toupper(c)) == 'G' || c2 == 'M')
+ else
{
- break;
+ char c2;
+ if (((c2 = toupper(c)) == 'G' || c2 == 'M') && gb.buffer[commandEnd - 1] != '\'')
+ {
+ break;
+ }
}
}
}