Skip to main content

Power Loss Resume

Configuration Method​

  • Supports power loss recovery and power loss recovery mode selection. You can choose layer-based recovery or power-loss point recovery.

    Loading...
    Loading...
  • Add the following code to Configuration.h

#define FLY_POWER
#define FLY_POWER_LOSS_PING PB11
#define FLY_POWER_LOSS_STATE HIGH
  • Add the following code to Marlin\src\MarlinCore.cpp
Note

WRITE( FLY_BEEP_PING , HIGH ); uses FLY_BEEP_PING (buzzer pin macro) as the power loss prompt tone; if this macro is not defined in the firmware source code you are using, please delete this line. You will only lose the buzzer prompt, and the power loss print recovery function will not be affected.

#if ENABLED(FLY_POWER)
// if (printJobOngoing() && (READ(FLY_POWER_LOSS_PING) == FLY_POWER_LOSS_STATE)){
if ( (READ(FLY_POWER_LOSS_PING) == FLY_POWER_LOSS_STATE)){
WRITE( FLY_BEEP_PING , HIGH );

// thermalManager.;
static millis_t send_power_ms = 0;
const millis_t power_ms = millis();
if((power_ms - send_power_ms ) >= 200){
thermalManager.setTargetBed(0);
SERIAL_ECHOLNPGM("power_LOSS");
//queue.inject_P(PSTR("M81"));
send_power_ms = millis();
}
}

#endif
Loading...