MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / AbortFile

Method AbortFile

src/GCodes/GCodeBuffer/GCodeBuffer.cpp:1060–1089  ·  view source on GitHub ↗

Abort execution of any files or macros being executed We now avoid popping the state if we were not executing from a file, so that if DWC or PanelDue is used to jog the axes before they are homed, we don't report stack underflow.

Source from the content-addressed store, hash-verified

1058// Abort execution of any files or macros being executed
1059// We now avoid popping the state if we were not executing from a file, so that if DWC or PanelDue is used to jog the axes before they are homed, we don't report stack underflow.
1060void GCodeBuffer::AbortFile(bool abortAll) noexcept
1061{
1062 if (machineState->DoingFile())
1063 {
1064 do
1065 {
1066 if (machineState->DoingFile())
1067 {
1068#if HAS_MASS_STORAGE || HAS_EMBEDDED_FILES
1069# if HAS_SBC_INTERFACE
1070 if (!reprap.UsingSbcInterface())
1071# endif
1072 {
1073 fileInput->Reset(machineState->fileState);
1074 }
1075#endif
1076 machineState->CloseFile();
1077 }
1078 } while (PopState(false) && abortAll);
1079
1080#if HAS_SBC_INTERFACE
1081 // Notify the SBC about the file(s) being closed
1082 if (reprap.UsingSbcInterface())
1083 {
1084 abortFile = true;
1085 abortAllFiles = abortAll;
1086 }
1087#endif
1088 }
1089}
1090
1091// This is called on a fileGCode when we stop a print. It closes the file and re-initialises the buffer.
1092void GCodeBuffer::ClosePrintFile() noexcept

Callers 6

SpinGCodeBufferMethod · 0.80
AbortPrintMethod · 0.80
DoFileMacroMethod · 0.80
FileMacroCyclesReturnMethod · 0.80
ExchangeDataMethod · 0.80
InvalidateResourcesMethod · 0.80

Calls 4

DoingFileMethod · 0.80
UsingSbcInterfaceMethod · 0.80
ResetMethod · 0.45
CloseFileMethod · 0.45

Tested by

no test coverage detected