Improve Power-Loss Recovery (#19540)

This commit is contained in:
Scott Lahteine
2020-09-28 15:52:21 -05:00
committed by GitHub
parent 6d4c82f4d8
commit 9142f5446a
4 changed files with 37 additions and 5 deletions

View File

@@ -107,6 +107,12 @@ typedef struct {
// Job elapsed time
millis_t print_job_elapsed;
// Misc. Marlin flags
struct {
bool dryrun:1; // M111 S8
bool allow_cold_extrusion:1; // M302 P1
} flag;
uint8_t valid_foot;
bool valid() { return valid_head && valid_head == valid_foot; }
@@ -173,7 +179,10 @@ class PrintJobRecovery {
}
#endif
static inline bool valid() { return info.valid(); }
// The referenced file exists
static inline bool interrupted_file_exists() { return card.fileExists(info.sd_filename); }
static inline bool valid() { return info.valid() && interrupted_file_exists(); }
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
static void debug(PGM_P const prefix);