Sfoglia il codice sorgente

Move Power Loss Recovery check

Scott Lahteine 5 anni fa
parent
commit
d96c769fd6

+ 0
- 4
Marlin/src/MarlinCore.cpp Vedi File

@@ -1161,10 +1161,6 @@ void setup() {
1161 1161
     SETUP_RUN(est_init());
1162 1162
   #endif
1163 1163
 
1164
-  #if ENABLED(POWER_LOSS_RECOVERY)
1165
-    SETUP_RUN(recovery.check());
1166
-  #endif
1167
-
1168 1164
   #if ENABLED(USE_WATCHDOG)
1169 1165
     SETUP_RUN(watchdog_init());       // Reinit watchdog after HAL_get_reset_source call
1170 1166
   #endif

+ 2
- 2
Marlin/src/feature/powerloss.cpp Vedi File

@@ -100,10 +100,10 @@ void PrintJobRecovery::changed() {
100 100
  * If a saved state exists send 'M1000 S' to initiate job recovery.
101 101
  */
102 102
 void PrintJobRecovery::check() {
103
-  if (!card.isMounted()) card.mount();
103
+  //if (!card.isMounted()) card.mount();
104 104
   if (card.isMounted()) {
105 105
     load();
106
-    if (!valid()) return purge();
106
+    if (!valid()) return cancel();
107 107
     queue.inject_P(PSTR("M1000 S"));
108 108
   }
109 109
 }

+ 7
- 2
Marlin/src/sd/cardreader.cpp Vedi File

@@ -408,8 +408,13 @@ void CardReader::manage_media() {
408 408
 
409 409
     ui.media_changed(old_stat, stat); // Update the UI
410 410
 
411
-    if (stat && old_stat == 2)        // First mount?
412
-      beginautostart();               // Look for autostart files soon
411
+    if (stat && old_stat == 2) {      // First mount?
412
+      #if ENABLED(POWER_LOSS_RECOVERY)
413
+        recovery.check();
414
+      #else
415
+        beginautostart();             // Look for autostart files soon
416
+      #endif
417
+    }
413 418
   }
414 419
 }
415 420
 

Loading…
Annulla
Salva