diff --git a/Marlin/src/feature/pause.h b/Marlin/src/feature/pause.h index 87cfe05f7ccdda388679e55d8cb93910426b6025..6cc901c1d90043cd1280d6524fb0613b79207e1f 100644 --- a/Marlin/src/feature/pause.h +++ b/Marlin/src/feature/pause.h @@ -92,4 +92,4 @@ bool load_filament(const float &slow_load_length=0, const float &fast_load_lengt bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT); -#endif //ADVANCED_PAUSE_FEATURE +#endif // ADVANCED_PAUSE_FEATURE diff --git a/Marlin/src/gcode/feature/pause/M125.cpp b/Marlin/src/gcode/feature/pause/M125.cpp index 09e61959207561082a9adf10ef2e20b41bf4c10e..5794f6af333ec79308cef1e500a81cda23d7a011 100644 --- a/Marlin/src/gcode/feature/pause/M125.cpp +++ b/Marlin/src/gcode/feature/pause/M125.cpp @@ -68,12 +68,13 @@ void GcodeSuite::M125() { park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); #endif + #if ENABLED(SDSUPPORT) + const bool sd_printing = IS_SD_PRINTING(); + #else + constexpr bool sd_printing = false; + #endif + if (pause_print(retract, park_point)) { - #if ENABLED(SDSUPPORT) - const bool sd_printing = IS_SD_PRINTING() || parser.boolval('S'); // Undocumented parameter - #else - constexpr bool sd_printing = false; - #endif if (!sd_printing) { wait_for_confirmation(); resume_print(); diff --git a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp index 4402186a12fda014bf67599f6b509853022656fa..b06765051d96ecb5bd693f7b36d1f33cbfdbf4a1 100644 --- a/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp +++ b/Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp @@ -91,17 +91,11 @@ void GcodeSuite::M24() { #if ENABLED(POWER_LOSS_RECOVERY) if (parser.seenval('S')) card.setIndex(parser.value_long()); + if (parser.seenval('T')) print_job_timer.resume(parser.value_long()); #endif card.startFileprint(); - - #if ENABLED(POWER_LOSS_RECOVERY) - if (parser.seenval('T')) - print_job_timer.resume(parser.value_long()); - else - #endif - print_job_timer.start(); - + print_job_timer.start(); ui.reset_status(); } @@ -109,11 +103,12 @@ void GcodeSuite::M24() { * M25: Pause SD Print */ void GcodeSuite::M25() { - card.pauseSDPrint(); - print_job_timer.pause(); - #if ENABLED(PARK_HEAD_ON_PAUSE) - enqueue_and_echo_commands_P(PSTR("M125 S")); // To be last in the buffer, must enqueue after pauseSDPrint + M125(); + #else + card.pauseSDPrint(); + print_job_timer.pause(); + ui.reset_status(); #endif } diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index cfb1dd0b205947f004af0f4d018aef1e42fcddb8..6217576858811b59c1769b202b864d6653884ace 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -54,8 +54,8 @@ #else card.startFileprint(); print_job_timer.start(); + ui.reset_status(); #endif - ui.reset_status(); } void lcd_sdcard_stop() { diff --git a/Marlin/src/libs/stopwatch.cpp b/Marlin/src/libs/stopwatch.cpp index 2817190aa6c01b9347bdf07293234bcdd665fb0c..3217fbc77744da809bae881f9787343877ac6161 100644 --- a/Marlin/src/libs/stopwatch.cpp +++ b/Marlin/src/libs/stopwatch.cpp @@ -71,13 +71,13 @@ bool Stopwatch::start() { else return false; } -void Stopwatch::resume(const millis_t duration) { +void Stopwatch::resume(const millis_t with_time) { #if ENABLED(DEBUG_STOPWATCH) Stopwatch::debug(PSTR("resume")); #endif reset(); - if ((accumulator = duration)) state = RUNNING; + if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { diff --git a/Marlin/src/libs/stopwatch.h b/Marlin/src/libs/stopwatch.h index c1e9ea74f891027ce282cc2e1ad78f550ac503a4..732c64f4102d7ab1cc860eec244da603f409a76e 100644 --- a/Marlin/src/libs/stopwatch.h +++ b/Marlin/src/libs/stopwatch.h @@ -75,7 +75,7 @@ class Stopwatch { * @brief Resume the stopwatch * @details Resume a timer from a given duration */ - static void resume(const millis_t duration); + static void resume(const millis_t with_time); /** * @brief Reset the stopwatch