Skip to content

Commit

Permalink
Allow print recovery after parking
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Feb 26, 2020
1 parent 6fd7f4f commit 18b875d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/feature/power_loss_recovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void PrintJobRecovery::prepare() {
/**
* Save the current machine state to the power-loss recovery file
*/
void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=true*/) {
void PrintJobRecovery::save(const bool force/*=false*/) {

#if SAVE_INFO_INTERVAL_MS > 0
static millis_t next_save_ms; // = 0
Expand Down
7 changes: 2 additions & 5 deletions Marlin/src/feature/power_loss_recovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,10 @@ class PrintJobRecovery {
static inline void cancel() { purge(); card.autostart_index = 0; }

static void load();
static void save(const bool force=
static void save(const bool force=false
#if ENABLED(SAVE_EACH_CMD_MODE)
true
#else
false
|| true
#endif
, const bool save_queue=true
);

#if PIN_EXISTS(POWER_LOSS)
Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/gcode/feature/pause/M125.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#include "../../../lcd/ultralcd.h"
#endif

#if ENABLED(POWER_LOSS_RECOVERY)
#include "../../../feature/power_loss_recovery.h"
#endif

/**
* M125: Store current position and move to parking position.
* Called on pause (by M25) to prevent material leaking onto the
Expand Down Expand Up @@ -85,6 +89,9 @@ void GcodeSuite::M125() {
#endif

if (pause_print(retract, park_point, 0, show_lcd)) {
#if ENABLED(POWER_LOSS_RECOVERY)
if (recovery.enabled) recovery.save(true);
#endif
if (!sd_printing || show_lcd) {
wait_for_confirmation(false, 0);
resume_print(0, 0, PAUSE_PARK_RETRACT_LENGTH, 0);
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/gcode/sdcard/M24_M25.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ void GcodeSuite::M24() {
*/
void GcodeSuite::M25() {

#if ENABLED(POWER_LOSS_RECOVERY)
if (recovery.enabled) recovery.save(true, false);
#endif

// Set initial pause flag to prevent more commands from landing in the queue while we try to pause
#if ENABLED(SDSUPPORT)
if (IS_SD_PRINTING()) card.pauseSDPrint();
Expand All @@ -101,6 +97,10 @@ void GcodeSuite::M25() {

#else

#if ENABLED(POWER_LOSS_RECOVERY)
if (recovery.enabled) recovery.save(true);
#endif

print_job_timer.pause();
ui.reset_status();

Expand Down

0 comments on commit 18b875d

Please sign in to comment.