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.
| 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. |
| 1060 | void 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. |
| 1092 | void GCodeBuffer::ClosePrintFile() noexcept |
no test coverage detected