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:
authorChristian Hammacher <bmasterc@gmail.com>2020-01-02 20:27:57 +0300
committerChristian Hammacher <bmasterc@gmail.com>2020-01-02 20:27:57 +0300
commit2a306af9f12da5440c725933fb1224efedf01849 (patch)
tree15dfcbe59ddc0a1b9636778767bbada188ba7aca
parent4bc3cfb5518e980b96a2bbfaddbeac9c3e1d3e08 (diff)
One more DSF-related hotfix
-rw-r--r--src/GCodes/GCodeBuffer/GCodeBuffer.cpp9
-rw-r--r--src/Linux/LinuxInterface.cpp45
2 files changed, 26 insertions, 28 deletions
diff --git a/src/GCodes/GCodeBuffer/GCodeBuffer.cpp b/src/GCodes/GCodeBuffer/GCodeBuffer.cpp
index ee94d056..d9913b68 100644
--- a/src/GCodes/GCodeBuffer/GCodeBuffer.cpp
+++ b/src/GCodes/GCodeBuffer/GCodeBuffer.cpp
@@ -24,18 +24,19 @@ GCodeBuffer::GCodeBuffer(GCodeChannel channel, GCodeInput *normalIn, FileGCodeIn
#endif
responseMessageType(mt), toolNumberAdjust(0), isBinaryBuffer(false), binaryParser(*this), stringParser(*this),
machineState(new GCodeMachineState())
-#if HAS_LINUX_INTERFACE
- , reportMissingMacro(false), isMacroFromCode(false), abortFile(false), abortAllFiles(false), reportStack(false)
-#endif
{
machineState->compatibility = c;
- Init();
+ Reset();
}
// Reset it to its state after start-up
void GCodeBuffer::Reset()
{
while (PopState(false)) { }
+#if HAS_LINUX_INTERFACE
+ requestedMacroFile.Clear();
+ reportMissingMacro = isMacroFromCode = abortFile = abortAllFiles = reportStack = false;
+#endif
isBinaryBuffer = false;
Init();
}
diff --git a/src/Linux/LinuxInterface.cpp b/src/Linux/LinuxInterface.cpp
index 3535b60c..25c6e8c7 100644
--- a/src/Linux/LinuxInterface.cpp
+++ b/src/Linux/LinuxInterface.cpp
@@ -419,37 +419,34 @@ void LinuxInterface::Spin()
}
wasConnected = true;
}
- else if (!transfer->IsConnected())
+ else if (!transfer->IsConnected() && wasConnected)
{
- if (wasConnected)
- {
- reprap.GetPlatform().Message(NetworkInfoMessage, "Lost connection to Linux\n");
+ reprap.GetPlatform().Message(NetworkInfoMessage, "Lost connection to Linux\n");
- wasConnected = false;
- numDisconnects++;
+ wasConnected = false;
+ numDisconnects++;
- rxPointer = txPointer = txLength = 0;
- sendBufferUpdate = true;
- iapWritePointer = IAP_IMAGE_START;
+ rxPointer = txPointer = txLength = 0;
+ sendBufferUpdate = true;
+ iapWritePointer = IAP_IMAGE_START;
- if (!requestedFileName.IsEmpty())
- {
- requestedFileDataLength = -1;
- requestedFileSemaphore.Give();
- }
+ if (!requestedFileName.IsEmpty())
+ {
+ requestedFileDataLength = -1;
+ requestedFileSemaphore.Give();
+ }
- // Don't cache any messages if they cannot be sent
- gcodeReply->ReleaseAll();
+ // Don't cache any messages if they cannot be sent
+ gcodeReply->ReleaseAll();
- // Close all open G-code files
- for (size_t i = 0; i < NumGCodeChannels; i++)
- {
- GCodeBuffer *gb = reprap.GetGCodes().GetGCodeBuffer((GCodeChannel)i);
- gb->AbortFile(true, false);
- gb->MessageAcknowledged(true);
- }
- reprap.GetGCodes().StopPrint(StopPrintReason::abort);
+ // Close all open G-code files
+ for (size_t i = 0; i < NumGCodeChannels; i++)
+ {
+ GCodeBuffer *gb = reprap.GetGCodes().GetGCodeBuffer((GCodeChannel)i);
+ gb->AbortFile(true, false);
+ gb->MessageAcknowledged(true);
}
+ reprap.GetGCodes().StopPrint(StopPrintReason::abort);
// Invalidate the G-code buffers holding binary data (if applicable)
for (size_t i = 0; i < NumGCodeChannels; i++)