|
|
@ -26,12 +26,16 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "../sd/cardreader.h"
|
|
|
|
#include "../sd/cardreader.h"
|
|
|
|
#include "../inc/MarlinConfigPre.h"
|
|
|
|
#include "../inc/MarlinConfig.h"
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(MIXING_EXTRUDER)
|
|
|
|
#if ENABLED(MIXING_EXTRUDER)
|
|
|
|
#include "../feature/mixing.h"
|
|
|
|
#include "../feature/mixing.h"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(POWER_LOSS_STATE) && PIN_EXISTS(POWER_LOSS)
|
|
|
|
|
|
|
|
#define POWER_LOSS_STATE HIGH
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
//#define DEBUG_POWER_LOSS_RECOVERY
|
|
|
|
//#define DEBUG_POWER_LOSS_RECOVERY
|
|
|
|
//#define SAVE_EACH_CMD_MODE
|
|
|
|
//#define SAVE_EACH_CMD_MODE
|
|
|
|
//#define SAVE_INFO_INTERVAL_MS 0
|
|
|
|
//#define SAVE_INFO_INTERVAL_MS 0
|
|
|
@ -110,6 +114,20 @@ class PrintJobRecovery {
|
|
|
|
|
|
|
|
|
|
|
|
static void init();
|
|
|
|
static void init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static inline void setup() {
|
|
|
|
|
|
|
|
#if PIN_EXISTS(POWER_LOSS)
|
|
|
|
|
|
|
|
#if ENABLED(POWER_LOSS_PULL)
|
|
|
|
|
|
|
|
#if POWER_LOSS_STATE == LOW
|
|
|
|
|
|
|
|
SET_INPUT_PULLUP(POWER_LOSS_PIN);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT_PULLDOWN(POWER_LOSS_PIN);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
SET_INPUT(POWER_LOSS_PIN);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool enabled;
|
|
|
|
static bool enabled;
|
|
|
|
static void enable(const bool onoff);
|
|
|
|
static void enable(const bool onoff);
|
|
|
|
static void changed();
|
|
|
|
static void changed();
|
|
|
|