Fix auto#.g file handling, add NO_SD_AUTOSTART (#20071)

This commit is contained in:
Scott Lahteine
2020-12-07 05:53:15 -06:00
committed by GitHub
parent b04914fb72
commit 7f20184ebc
9 changed files with 78 additions and 56 deletions

View File

@@ -460,6 +460,7 @@ void startOrResumeJob() {
#if ENABLED(SDSUPPORT)
inline void abortSDPrinting() {
IF_DISABLED(NO_SD_AUTOSTART, card.autofile_cancel());
card.endFilePrint(TERN_(SD_RESORT, true));
queue.clear();
quickstop_stepper();
@@ -585,7 +586,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
if (ELAPSED(ms, next_home_key_ms)) {
next_home_key_ms = ms + HOME_DEBOUNCE_DELAY;
LCD_MESSAGEPGM(MSG_AUTO_HOME);
queue.enqueue_now_P(G28_STR);
queue.inject_P(G28_STR);
}
}
#endif
@@ -1354,7 +1355,6 @@ void loop() {
idle();
#if ENABLED(SDSUPPORT)
card.checkautostart();
if (card.flag.abort_sd_printing) abortSDPrinting();
if (marlin_state == MF_SD_COMPLETE) finishSDPrinting();
#endif