Quellcode durchsuchen

Fix Power Loss Recovery file delete (#13522)

Robby Candra vor 6 Jahren
Ursprung
Commit
a3f67acd6d

+ 2
- 0
Marlin/src/feature/power_loss_recovery.cpp Datei anzeigen

@@ -222,6 +222,8 @@ void PrintJobRecovery::write() {
222 222
   open(false);
223 223
   file.seekSet(0);
224 224
   const int16_t ret = file.write(&info, sizeof(info));
225
+  close();
226
+
225 227
   #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
226 228
     if (ret == -1) SERIAL_ECHOLNPGM("Power-loss file write failed.");
227 229
   #else

+ 1
- 1
Marlin/src/gcode/feature/powerloss/M413.cpp Datei anzeigen

@@ -50,7 +50,7 @@ void GcodeSuite::M413() {
50 50
     if (parser.seen('R') || parser.seen('L')) recovery.load();
51 51
     if (parser.seen('W')) recovery.save(true);
52 52
     if (parser.seen('P')) recovery.purge();
53
-    if (parser.seen('E')) serialprintPGM(recovery.exists() ? PSTR("BIN Exists\n") : PSTR("No BIN\n"));
53
+    if (parser.seen('E')) serialprintPGM(recovery.exists() ? PSTR("PLR Exists\n") : PSTR("No PLR\n"));
54 54
     if (parser.seen('V')) serialprintPGM(recovery.valid() ? PSTR("Valid\n") : PSTR("Invalid\n"));
55 55
   #endif
56 56
 }

+ 1
- 2
Marlin/src/sd/cardreader.cpp Datei anzeigen

@@ -1004,7 +1004,7 @@ void CardReader::printingHasFinished() {
1004 1004
 
1005 1005
 #if ENABLED(POWER_LOSS_RECOVERY)
1006 1006
 
1007
-  constexpr char job_recovery_file_name[4] = "BIN";
1007
+  constexpr char job_recovery_file_name[4] = "PLR";
1008 1008
 
1009 1009
   bool CardReader::jobRecoverFileExists() {
1010 1010
     const bool exists = recovery.file.open(&root, job_recovery_file_name, O_READ);
@@ -1026,7 +1026,6 @@ void CardReader::printingHasFinished() {
1026 1026
   // be zeroed and written instead of deleted.
1027 1027
   void CardReader::removeJobRecoveryFile() {
1028 1028
     if (jobRecoverFileExists()) {
1029
-      //closefile();
1030 1029
       removeFile(job_recovery_file_name);
1031 1030
       #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
1032 1031
         SERIAL_ECHOPGM("Power-loss file delete");

Laden…
Abbrechen
Speichern