Bläddra i källkod

Fix Power Loss Recovery file delete (#13522)

Robby Candra 6 år sedan
förälder
incheckning
a3f67acd6d

+ 2
- 0
Marlin/src/feature/power_loss_recovery.cpp Visa fil

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

+ 1
- 1
Marlin/src/gcode/feature/powerloss/M413.cpp Visa fil

50
     if (parser.seen('R') || parser.seen('L')) recovery.load();
50
     if (parser.seen('R') || parser.seen('L')) recovery.load();
51
     if (parser.seen('W')) recovery.save(true);
51
     if (parser.seen('W')) recovery.save(true);
52
     if (parser.seen('P')) recovery.purge();
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
     if (parser.seen('V')) serialprintPGM(recovery.valid() ? PSTR("Valid\n") : PSTR("Invalid\n"));
54
     if (parser.seen('V')) serialprintPGM(recovery.valid() ? PSTR("Valid\n") : PSTR("Invalid\n"));
55
   #endif
55
   #endif
56
 }
56
 }

+ 1
- 2
Marlin/src/sd/cardreader.cpp Visa fil

1004
 
1004
 
1005
 #if ENABLED(POWER_LOSS_RECOVERY)
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
   bool CardReader::jobRecoverFileExists() {
1009
   bool CardReader::jobRecoverFileExists() {
1010
     const bool exists = recovery.file.open(&root, job_recovery_file_name, O_READ);
1010
     const bool exists = recovery.file.open(&root, job_recovery_file_name, O_READ);
1026
   // be zeroed and written instead of deleted.
1026
   // be zeroed and written instead of deleted.
1027
   void CardReader::removeJobRecoveryFile() {
1027
   void CardReader::removeJobRecoveryFile() {
1028
     if (jobRecoverFileExists()) {
1028
     if (jobRecoverFileExists()) {
1029
-      //closefile();
1030
       removeFile(job_recovery_file_name);
1029
       removeFile(job_recovery_file_name);
1031
       #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
1030
       #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
1032
         SERIAL_ECHOPGM("Power-loss file delete");
1031
         SERIAL_ECHOPGM("Power-loss file delete");

Laddar…
Avbryt
Spara