Merge upstream changes from Marlin 2.1.1
This commit is contained in:
@@ -152,7 +152,7 @@ class PrintJobRecovery {
|
||||
static void init();
|
||||
static void prepare();
|
||||
|
||||
static inline void setup() {
|
||||
static void setup() {
|
||||
#if PIN_EXISTS(POWER_LOSS)
|
||||
#if ENABLED(POWER_LOSS_PULLUP)
|
||||
SET_INPUT_PULLUP(POWER_LOSS_PIN);
|
||||
@@ -165,28 +165,28 @@ class PrintJobRecovery {
|
||||
}
|
||||
|
||||
// Track each command's file offsets
|
||||
static inline uint32_t command_sdpos() { return sdpos[queue_index_r]; }
|
||||
static inline void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; }
|
||||
static uint32_t command_sdpos() { return sdpos[queue_index_r]; }
|
||||
static void commit_sdpos(const uint8_t index_w) { sdpos[index_w] = cmd_sdpos; }
|
||||
|
||||
static bool enabled;
|
||||
static void enable(const bool onoff);
|
||||
static void changed();
|
||||
|
||||
static inline bool exists() { return card.jobRecoverFileExists(); }
|
||||
static inline void open(const bool read) { card.openJobRecoveryFile(read); }
|
||||
static inline void close() { file.close(); }
|
||||
static bool exists() { return card.jobRecoverFileExists(); }
|
||||
static void open(const bool read) { card.openJobRecoveryFile(read); }
|
||||
static void close() { file.close(); }
|
||||
|
||||
static void check();
|
||||
static bool check();
|
||||
static void resume();
|
||||
static void purge();
|
||||
|
||||
static inline void cancel() { purge(); IF_DISABLED(NO_SD_AUTOSTART, card.autofile_begin()); }
|
||||
static void cancel() { purge(); }
|
||||
|
||||
static void load();
|
||||
static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE), const float zraise=POWER_LOSS_ZRAISE, const bool raised=false);
|
||||
|
||||
#if PIN_EXISTS(POWER_LOSS)
|
||||
static inline void outage() {
|
||||
static void outage() {
|
||||
static constexpr uint8_t OUTAGE_THRESHOLD = 3;
|
||||
static uint8_t outage_counter = 0;
|
||||
if (enabled && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) {
|
||||
@@ -199,14 +199,14 @@ class PrintJobRecovery {
|
||||
#endif
|
||||
|
||||
// The referenced file exists
|
||||
static inline bool interrupted_file_exists() { return card.fileExists(info.sd_filename); }
|
||||
static bool interrupted_file_exists() { return card.fileExists(info.sd_filename); }
|
||||
|
||||
static inline bool valid() { return info.valid() && interrupted_file_exists(); }
|
||||
static bool valid() { return info.valid() && interrupted_file_exists(); }
|
||||
|
||||
#if ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
||||
static void debug(PGM_P const prefix);
|
||||
static void debug(FSTR_P const prefix);
|
||||
#else
|
||||
static inline void debug(PGM_P const) {}
|
||||
static void debug(FSTR_P const) {}
|
||||
#endif
|
||||
|
||||
private:
|
||||
@@ -216,9 +216,9 @@ class PrintJobRecovery {
|
||||
static void retract_and_lift(const_float_t zraise);
|
||||
#endif
|
||||
|
||||
#if PIN_EXISTS(POWER_LOSS)
|
||||
#if PIN_EXISTS(POWER_LOSS) || ENABLED(DEBUG_POWER_LOSS_RECOVERY)
|
||||
friend class GcodeSuite;
|
||||
static void _outage();
|
||||
static void _outage(TERN_(DEBUG_POWER_LOSS_RECOVERY, const bool simulated=false));
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user