|
@@ -112,8 +112,7 @@ void PrintJobRecovery::check() {
|
112
|
112
|
if (card.isMounted()) {
|
113
|
113
|
load();
|
114
|
114
|
if (!valid()) return cancel();
|
115
|
|
- queue.inject_P(PSTR("M1000 S"));
|
116
|
|
- TERN_(DWIN_CREALITY_LCD, dwin_flag = true);
|
|
115
|
+ queue.inject_P(PSTR("M1000S"));
|
117
|
116
|
}
|
118
|
117
|
}
|
119
|
118
|
|
|
@@ -227,6 +226,10 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=0*/
|
227
|
226
|
// Elapsed print job time
|
228
|
227
|
info.print_job_elapsed = print_job_timer.duration();
|
229
|
228
|
|
|
229
|
+ // Misc. Marlin flags
|
|
230
|
+ info.flag.dryrun = !!(marlin_debug_flags & MARLIN_DEBUG_DRYRUN);
|
|
231
|
+ info.flag.allow_cold_extrusion = TERN0(PREVENT_COLD_EXTRUSION, thermalManager.allow_cold_extrude);
|
|
232
|
+
|
230
|
233
|
write();
|
231
|
234
|
}
|
232
|
235
|
}
|
|
@@ -326,6 +329,12 @@ void PrintJobRecovery::resume() {
|
326
|
329
|
|
327
|
330
|
const uint32_t resume_sdpos = info.sdpos; // Get here before the stepper ISR overwrites it
|
328
|
331
|
|
|
332
|
+ // Apply the dry-run flag if enabled
|
|
333
|
+ if (info.flag.dryrun) marlin_debug_flags |= MARLIN_DEBUG_DRYRUN;
|
|
334
|
+
|
|
335
|
+ // Restore cold extrusion permission
|
|
336
|
+ TERN_(PREVENT_COLD_EXTRUSION, thermalManager.allow_cold_extrude = info.flag.allow_cold_extrusion);
|
|
337
|
+
|
329
|
338
|
#if HAS_LEVELING
|
330
|
339
|
// Make sure leveling is off before any G92 and G28
|
331
|
340
|
gcode.process_subcommands_now_P(PSTR("M420 S0 Z0"));
|
|
@@ -337,7 +346,7 @@ void PrintJobRecovery::resume() {
|
337
|
346
|
// If Z homing goes to max, just reset E and home all
|
338
|
347
|
gcode.process_subcommands_now_P(PSTR(
|
339
|
348
|
"G92.9 E0\n"
|
340
|
|
- "G28R0" TERN_(MARLIN_DEV_MODE, "S")
|
|
349
|
+ "G28R0"
|
341
|
350
|
));
|
342
|
351
|
|
343
|
352
|
#else // "G92.9 E0 ..."
|
|
@@ -358,7 +367,6 @@ void PrintJobRecovery::resume() {
|
358
|
367
|
|
359
|
368
|
gcode.process_subcommands_now_P(PSTR(
|
360
|
369
|
"G28R0" // No raise during G28
|
361
|
|
- TERN_(MARLIN_DEV_MODE, "S") // Simulated Homing
|
362
|
370
|
TERN_(IS_CARTESIAN, "XY") // Don't home Z on Cartesian
|
363
|
371
|
));
|
364
|
372
|
|
|
@@ -498,6 +506,14 @@ void PrintJobRecovery::resume() {
|
498
|
506
|
LOOP_XYZ(i) update_workspace_offset((AxisEnum)i);
|
499
|
507
|
#endif
|
500
|
508
|
|
|
509
|
+ #if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
|
510
|
+ const uint8_t old_flags = marlin_debug_flags;
|
|
511
|
+ marlin_debug_flags |= MARLIN_DEBUG_ECHO;
|
|
512
|
+ #endif
|
|
513
|
+
|
|
514
|
+ // Continue to apply PLR when a file is resumed!
|
|
515
|
+ enable(true);
|
|
516
|
+
|
501
|
517
|
// Resume the SD file from the last position
|
502
|
518
|
char *fn = info.sd_filename;
|
503
|
519
|
extern const char M23_STR[];
|
|
@@ -505,6 +521,8 @@ void PrintJobRecovery::resume() {
|
505
|
521
|
gcode.process_subcommands_now(cmd);
|
506
|
522
|
sprintf_P(cmd, PSTR("M24 S%ld T%ld"), resume_sdpos, info.print_job_elapsed);
|
507
|
523
|
gcode.process_subcommands_now(cmd);
|
|
524
|
+
|
|
525
|
+ TERN_(DEBUG_POWER_LOSS_RECOVERY, marlin_debug_flags = old_flags);
|
508
|
526
|
}
|
509
|
527
|
|
510
|
528
|
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
|
@@ -584,6 +602,8 @@ void PrintJobRecovery::resume() {
|
584
|
602
|
DEBUG_ECHOLNPAIR("sd_filename: ", info.sd_filename);
|
585
|
603
|
DEBUG_ECHOLNPAIR("sdpos: ", info.sdpos);
|
586
|
604
|
DEBUG_ECHOLNPAIR("print_job_elapsed: ", info.print_job_elapsed);
|
|
605
|
+ DEBUG_ECHOLNPAIR("dryrun: ", int(info.flag.dryrun));
|
|
606
|
+ DEBUG_ECHOLNPAIR("allow_cold_extrusion: ", int(info.flag.allow_cold_extrusion));
|
587
|
607
|
}
|
588
|
608
|
else
|
589
|
609
|
DEBUG_ECHOLNPGM("INVALID DATA");
|