Abort SD printing more safely (#10405)

Allow the current command to complete when aborting an SD print, otherwise some commands (G28, G29, etc.) will cause trouble.
This commit is contained in:
Scott Lahteine
2018-04-15 18:26:25 -05:00
committed by GitHub
parent 110e631656
commit d59ed4dce0
3 changed files with 34 additions and 15 deletions

View File

@@ -829,20 +829,10 @@ void kill_screen(const char* lcd_msg) {
lcd_reset_status();
}
bool abort_sd_printing; // =false
void lcd_sdcard_stop() {
card.stopSDPrint(
#if SD_RESORT
true
#endif
);
clear_command_queue();
quickstop_stepper();
print_job_timer.stop();
thermalManager.disable_all_heaters();
#if FAN_COUNT > 0
for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0;
#endif
wait_for_heatup = false;
abort_sd_printing = true;
lcd_setstatusPGM(PSTR(MSG_PRINT_ABORTED), -1);
lcd_return_to_status();
}