From 742733d714a7907347a98ffa0bfa0ac9d88817c8 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 23 Feb 2018 13:42:21 -0600 Subject: [PATCH] Un-pause on print cancellation (#9779) --- Marlin/Marlin.h | 1 + Marlin/Marlin_main.cpp | 2 +- Marlin/cardreader.cpp | 3 +++ Marlin/malyanlcd.cpp | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index e62c5202cf..4864309c5b 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -449,6 +449,7 @@ void report_current_position(); #endif #if ENABLED(ADVANCED_PAUSE_FEATURE) + extern int8_t did_pause_print; extern AdvancedPauseMenuResponse advanced_pause_menu_response; extern float filament_change_unload_length[EXTRUDERS], filament_change_load_length[EXTRUDERS]; diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 857fc73dab..761b533f38 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -6406,7 +6406,7 @@ inline void gcode_M17() { } static float resume_position[XYZE]; - static int8_t did_pause_print = 0; + int8_t did_pause_print = 0; #if HAS_BUZZER static void filament_change_beep(const int8_t max_beep_count, const bool init=false) { diff --git a/Marlin/cardreader.cpp b/Marlin/cardreader.cpp index dcf33d8952..b07fd10e4f 100644 --- a/Marlin/cardreader.cpp +++ b/Marlin/cardreader.cpp @@ -296,6 +296,9 @@ void CardReader::startFileprint() { } void CardReader::stopSDPrint() { + #if ENABLED(ADVANCED_PAUSE_FEATURE) + did_pause_print = 0; + #endif sdprinting = false; if (isFileOpen()) file.close(); } diff --git a/Marlin/malyanlcd.cpp b/Marlin/malyanlcd.cpp index 69ccd3c1f0..aa60d22044 100644 --- a/Marlin/malyanlcd.cpp +++ b/Marlin/malyanlcd.cpp @@ -225,6 +225,7 @@ void process_lcd_p_command(const char* command) { case 'X': // cancel print write_to_lcd_P(PSTR("{SYS:CANCELING}")); + card.stopSDPrint(); clear_command_queue(); quickstop_stepper(); print_job_timer.stop();