Parcourir la source

Allow print recovery after parking

Scott Lahteine il y a 5 ans
Parent
révision
18b875dc9f

+ 1
- 1
Marlin/src/feature/power_loss_recovery.cpp Voir le fichier

141
 /**
141
 /**
142
  * Save the current machine state to the power-loss recovery file
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
   #if SAVE_INFO_INTERVAL_MS > 0
146
   #if SAVE_INFO_INTERVAL_MS > 0
147
     static millis_t next_save_ms; // = 0
147
     static millis_t next_save_ms; // = 0

+ 2
- 5
Marlin/src/feature/power_loss_recovery.h Voir le fichier

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

+ 7
- 0
Marlin/src/gcode/feature/pause/M125.cpp Voir le fichier

35
   #include "../../../lcd/ultralcd.h"
35
   #include "../../../lcd/ultralcd.h"
36
 #endif
36
 #endif
37
 
37
 
38
+#if ENABLED(POWER_LOSS_RECOVERY)
39
+  #include "../../../feature/power_loss_recovery.h"
40
+#endif
41
+
38
 /**
42
 /**
39
  * M125: Store current position and move to parking position.
43
  * M125: Store current position and move to parking position.
40
  *       Called on pause (by M25) to prevent material leaking onto the
44
  *       Called on pause (by M25) to prevent material leaking onto the
85
   #endif
89
   #endif
86
 
90
 
87
   if (pause_print(retract, park_point, 0, show_lcd)) {
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
     if (!sd_printing || show_lcd) {
95
     if (!sd_printing || show_lcd) {
89
       wait_for_confirmation(false, 0);
96
       wait_for_confirmation(false, 0);
90
       resume_print(0, 0, PAUSE_PARK_RETRACT_LENGTH, 0);
97
       resume_print(0, 0, PAUSE_PARK_RETRACT_LENGTH, 0);

+ 4
- 4
Marlin/src/gcode/sdcard/M24_M25.cpp Voir le fichier

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

Chargement…
Annuler
Enregistrer