1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 13:56:24 +00:00

Move abortSDPrinting with others

This commit is contained in:
Scott Lahteine 2019-10-29 16:00:17 -05:00
parent 55c3929359
commit 583fc4ee2a

View File

@ -378,6 +378,28 @@ void startOrResumeJob() {
print_job_timer.start(); 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: * Manage several activities:
* - Check for Filament Runout * - Check for Filament Runout
@ -1124,34 +1146,12 @@ void loop() {
idle(); // Do an idle first so boot is slightly faster idle(); // Do an idle first so boot is slightly faster
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
card.checkautostart(); card.checkautostart();
if (card.flag.abort_sd_printing) abortSDPrinting();
if (card.flag.abort_sd_printing) {
card.stopSDPrint(
#if SD_RESORT
true
#endif #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
queue.advance(); queue.advance();
endstops.event_handler(); endstops.event_handler();
} }
} }