From 583fc4ee2aa2255fa458571ccd2a7934bb265aa4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 29 Oct 2019 16:00:17 -0500 Subject: [PATCH] Move abortSDPrinting with others --- Marlin/src/Marlin.cpp | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 40ce54fb9..a49fd586d 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -378,6 +378,28 @@ void startOrResumeJob() { print_job_timer.start(); } +void abortSDPrinting() { + card.stopSDPrint( + #if SD_RESORT + true + #endif + ); + queue.clear(); + quickstop_stepper(); + print_job_timer.stop(); + #if DISABLED(SD_ABORT_NO_COOLDOWN) + thermalManager.disable_all_heaters(); + #endif + thermalManager.zero_fan_speeds(); + wait_for_heatup = false; + #if ENABLED(POWER_LOSS_RECOVERY) + card.removeJobRecoveryFile(); + #endif + #ifdef EVENT_GCODE_SD_STOP + queue.inject_P(PSTR(EVENT_GCODE_SD_STOP)); + #endif +} + /** * Manage several activities: * - Check for Filament Runout @@ -1124,34 +1146,12 @@ void loop() { idle(); // Do an idle first so boot is slightly faster #if ENABLED(SDSUPPORT) - card.checkautostart(); - - if (card.flag.abort_sd_printing) { - card.stopSDPrint( - #if SD_RESORT - true - #endif - ); - queue.clear(); - quickstop_stepper(); - print_job_timer.stop(); - #if DISABLED(SD_ABORT_NO_COOLDOWN) - thermalManager.disable_all_heaters(); - #endif - thermalManager.zero_fan_speeds(); - wait_for_heatup = false; - #if ENABLED(POWER_LOSS_RECOVERY) - card.removeJobRecoveryFile(); - #endif - #ifdef EVENT_GCODE_SD_STOP - queue.inject_P(PSTR(EVENT_GCODE_SD_STOP)); - #endif - } - - #endif // SDSUPPORT + if (card.flag.abort_sd_printing) abortSDPrinting(); + #endif queue.advance(); + endstops.event_handler(); } }