diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-07-30 10:17:45 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-07-30 10:17:45 +0300 |
commit | 7c5ef6000bdeebfa8d51c0ead656ea554f1eb882 (patch) | |
tree | 170bd0a4bc3f8282d6a97f16498b356a64b2f925 /src/GCodes | |
parent | 7b0dde7831f35450b6c5c077b00821b118eb9570 (diff) | |
parent | d7fd1866ffbfbb87229fa89ae2c7add48307cd8a (diff) |
Merge branch 'v3-chrishamm' into 3.4-input-shaping
Diffstat (limited to 'src/GCodes')
-rw-r--r-- | src/GCodes/GCodeBuffer/ExpressionParser.cpp | 6 | ||||
-rw-r--r-- | src/GCodes/GCodeBuffer/ExpressionParser.h | 2 | ||||
-rw-r--r-- | src/GCodes/GCodes.cpp | 12 | ||||
-rw-r--r-- | src/GCodes/GCodes2.cpp | 14 | ||||
-rw-r--r-- | src/GCodes/GCodes3.cpp | 8 |
5 files changed, 22 insertions, 20 deletions
diff --git a/src/GCodes/GCodeBuffer/ExpressionParser.cpp b/src/GCodes/GCodeBuffer/ExpressionParser.cpp index 60d5db79..0c65a39c 100644 --- a/src/GCodes/GCodeBuffer/ExpressionParser.cpp +++ b/src/GCodes/GCodeBuffer/ExpressionParser.cpp @@ -812,10 +812,12 @@ void ExpressionParser::SkipWhiteSpace() noexcept } } -void ExpressionParser::CheckForExtraCharacters() THROWS(GCodeException) +void ExpressionParser::CheckForExtraCharacters(bool isArrayExpression) THROWS(GCodeException) { SkipWhiteSpace(); - if (CurrentCharacter() != 0) + + char c = CurrentCharacter(); + if (c != 0 && (!isArrayExpression || (c != EXPRESSION_LIST_SEPARATOR && c != LIST_SEPARATOR))) { ThrowParseException("Unexpected characters after expression"); } diff --git a/src/GCodes/GCodeBuffer/ExpressionParser.h b/src/GCodes/GCodeBuffer/ExpressionParser.h index 25ad7470..adfff7c7 100644 --- a/src/GCodes/GCodeBuffer/ExpressionParser.h +++ b/src/GCodes/GCodeBuffer/ExpressionParser.h @@ -33,7 +33,7 @@ public: void ParseDriverIdArray(DriverId arr[], size_t& length) THROWS(GCodeException); void SkipWhiteSpace() noexcept; - void CheckForExtraCharacters() THROWS(GCodeException); + void CheckForExtraCharacters(bool isArrayExpression = false) THROWS(GCodeException); const char *GetEndptr() const noexcept { return currentp; } private: diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp index a4c36491..85e88c33 100644 --- a/src/GCodes/GCodes.cpp +++ b/src/GCodes/GCodes.cpp @@ -479,16 +479,10 @@ void GCodes::Spin() noexcept #if HAS_LINUX_INTERFACE - if (reprap.UsingLinuxInterface()) + // Need to check if the print has been stopped by the SBC + if (reprap.UsingLinuxInterface() && reprap.GetLinuxInterface().HasPrintStopped()) { - if (reprap.GetLinuxInterface().HasPrintStarted()) - { - StartPrinting(true); - } - else if (reprap.GetLinuxInterface().HasPrintStopped()) - { - StopPrint(reprap.GetLinuxInterface().GetPrintStopReason()); - } + StopPrint(reprap.GetLinuxInterface().GetPrintStopReason()); } #endif diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp index 84cee85f..ee50c201 100644 --- a/src/GCodes/GCodes2.cpp +++ b/src/GCodes/GCodes2.cpp @@ -829,7 +829,9 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx result = MassStorage::Unmount(card, reply); } break; +#endif +#if HAS_MASS_STORAGE || HAS_LINUX_INTERFACE case 23: // Set file to print case 32: // Select file and start SD print // We now allow a file that is being printed to chain to another file. This is required for the resume-after-power-fail functionality. @@ -847,7 +849,17 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) THROWS(GCodeEx { String<MaxFilenameLength> filename; gb.GetUnprecedentedString(filename.GetRef()); - if (QueueFileToPrint(filename.c_str(), reply)) + if ( +#if HAS_LINUX_INTERFACE + reprap.UsingLinuxInterface() +# if HAS_MASS_STORAGE + || +# endif +#endif +#if HAS_MASS_STORAGE + QueueFileToPrint(filename.c_str(), reply) +#endif + ) { reprap.GetPrintMonitor().StartingPrint(filename.c_str()); if (gb.LatestMachineState().compatibility == Compatibility::Marlin) diff --git a/src/GCodes/GCodes3.cpp b/src/GCodes/GCodes3.cpp index 74ba76a9..42388844 100644 --- a/src/GCodes/GCodes3.cpp +++ b/src/GCodes/GCodes3.cpp @@ -432,13 +432,7 @@ GCodeResult GCodes::SimulateFile(GCodeBuffer& gb, const StringRef &reply, const simulationMode = 1; reprap.GetMove().Simulate(simulationMode); reprap.GetPrintMonitor().StartingPrint(file.c_str()); -# if HAS_LINUX_INTERFACE - if (!reprap.UsingLinuxInterface()) -# endif - { - // If using a SBC, this is already called when the print file info is set - StartPrinting(true); - } + StartPrinting(true); reply.printf("Simulating print of file %s", file.c_str()); return GCodeResult::ok; } |