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-06-13 01:21:27 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-06-13 01:21:27 +0300
commita7fde45b618c76c03516696d670dd665282873da (patch)
tree250ec090839017aeac12e7cefa9d1f19dea35835 /src/GCodes/GCodeBuffer/StringParser.cpp
parent92b7d130d974b6b62780e68d32717a7c6567db6e (diff)
Various
Support layer counting in GCode files generated by SuperSlicer When reporting a bad command, display any non-printing characters in hex Support measuring fan RPMs down to 160 instead of down to 320 After turning a remote heater on, if it was previously off then set its status to 'heating' pending receiving updated status for it, to make sure that M116 waits for it
Diffstat (limited to 'src/GCodes/GCodeBuffer/StringParser.cpp')
-rw-r--r--src/GCodes/GCodeBuffer/StringParser.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/GCodes/GCodeBuffer/StringParser.cpp b/src/GCodes/GCodeBuffer/StringParser.cpp
index abf822e5..8b4df0f0 100644
--- a/src/GCodes/GCodeBuffer/StringParser.cpp
+++ b/src/GCodes/GCodeBuffer/StringParser.cpp
@@ -266,7 +266,7 @@ bool StringParser::Put(char c) noexcept
// This is called when we are fed a null, CR or LF character.
// Return true if there is a completed command ready to be executed.
-bool StringParser::LineFinished()
+bool StringParser::LineFinished() noexcept
{
if (hadLineNumber)
{
@@ -1486,9 +1486,21 @@ void StringParser::PrintCommand(const StringRef& s) const noexcept
}
// Append the full command content to a string
+// This is called when we report a "Bad command" error, so make sure we display any control characters.
void StringParser::AppendFullCommand(const StringRef &s) const noexcept
{
- s.cat(gb.buffer);
+ for (size_t i = commandStart; i < commandEnd; ++i)
+ {
+ const char c = gb.buffer[i];
+ if (c < 0x20)
+ {
+ s.catf("[0x%02x]", (unsigned int)c);
+ }
+ else
+ {
+ s.cat(c);
+ }
+ }
}
// Called when we start a new file