Przeglądaj źródła

Allow print recovery after parking

Scott Lahteine 4 lat temu
rodzic
commit
18b875dc9f

+ 1
- 1
Marlin/src/feature/power_loss_recovery.cpp Wyświetl plik

@@ -141,7 +141,7 @@ void PrintJobRecovery::prepare() {
141 141
 /**
142 142
  * Save the current machine state to the power-loss recovery file
143 143
  */
144
-void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=true*/) {
144
+void PrintJobRecovery::save(const bool force/*=false*/) {
145 145
 
146 146
   #if SAVE_INFO_INTERVAL_MS > 0
147 147
     static millis_t next_save_ms; // = 0

+ 2
- 5
Marlin/src/feature/power_loss_recovery.h Wyświetl plik

@@ -159,13 +159,10 @@ class PrintJobRecovery {
159 159
     static inline void cancel() { purge(); card.autostart_index = 0; }
160 160
 
161 161
     static void load();
162
-    static void save(const bool force=
162
+    static void save(const bool force=false
163 163
       #if ENABLED(SAVE_EACH_CMD_MODE)
164
-        true
165
-      #else
166
-        false
164
+        || true
167 165
       #endif
168
-      , const bool save_queue=true
169 166
     );
170 167
 
171 168
   #if PIN_EXISTS(POWER_LOSS)

+ 7
- 0
Marlin/src/gcode/feature/pause/M125.cpp Wyświetl plik

@@ -35,6 +35,10 @@
35 35
   #include "../../../lcd/ultralcd.h"
36 36
 #endif
37 37
 
38
+#if ENABLED(POWER_LOSS_RECOVERY)
39
+  #include "../../../feature/power_loss_recovery.h"
40
+#endif
41
+
38 42
 /**
39 43
  * M125: Store current position and move to parking position.
40 44
  *       Called on pause (by M25) to prevent material leaking onto the
@@ -85,6 +89,9 @@ void GcodeSuite::M125() {
85 89
   #endif
86 90
 
87 91
   if (pause_print(retract, park_point, 0, show_lcd)) {
92
+    #if ENABLED(POWER_LOSS_RECOVERY)
93
+      if (recovery.enabled) recovery.save(true);
94
+    #endif
88 95
     if (!sd_printing || show_lcd) {
89 96
       wait_for_confirmation(false, 0);
90 97
       resume_print(0, 0, PAUSE_PARK_RETRACT_LENGTH, 0);

+ 4
- 4
Marlin/src/gcode/sdcard/M24_M25.cpp Wyświetl plik

@@ -86,10 +86,6 @@ void GcodeSuite::M24() {
86 86
  */
87 87
 void GcodeSuite::M25() {
88 88
 
89
-  #if ENABLED(POWER_LOSS_RECOVERY)
90
-    if (recovery.enabled) recovery.save(true, false);
91
-  #endif
92
-
93 89
   // Set initial pause flag to prevent more commands from landing in the queue while we try to pause
94 90
   #if ENABLED(SDSUPPORT)
95 91
     if (IS_SD_PRINTING()) card.pauseSDPrint();
@@ -101,6 +97,10 @@ void GcodeSuite::M25() {
101 97
 
102 98
   #else
103 99
 
100
+    #if ENABLED(POWER_LOSS_RECOVERY)
101
+      if (recovery.enabled) recovery.save(true);
102
+    #endif
103
+
104 104
     print_job_timer.pause();
105 105
     ui.reset_status();
106 106
 

Ładowanie…
Anuluj
Zapisz