Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,7 @@
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power-loss
#if ENABLED(BACKUP_POWER_SUPPLY)
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail
#define POWER_LOSS_UNRETRACT_LEN POWER_LOSS_RETRACT_LEN // (mm) Length of filament to unretract on resume
#endif

// Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled!
Expand Down
9 changes: 5 additions & 4 deletions Marlin/src/feature/powerloss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ PrintJobRecovery recovery;
#undef POWER_LOSS_RETRACT_LEN // No retract at outage without backup power
#endif
#ifndef POWER_LOSS_RETRACT_LEN
#define POWER_LOSS_RETRACT_LEN 0
#define POWER_LOSS_RETRACT_LEN 0
#define POWER_LOSS_UNRETRACT_LEN 0
#endif
#ifndef POWER_LOSS_PURGE_LEN
#define POWER_LOSS_PURGE_LEN 0
Expand Down Expand Up @@ -548,13 +549,13 @@ void PrintJobRecovery::resume() {
#endif

// Un-retract if there was a retract at outage
#if ENABLED(BACKUP_POWER_SUPPLY) && POWER_LOSS_RETRACT_LEN > 0
PROCESS_SUBCOMMANDS_NOW(F("G1F3000E" STRINGIFY(POWER_LOSS_RETRACT_LEN)));
#if ENABLED(BACKUP_POWER_SUPPLY) && POWER_LOSS_UNRETRACT_LEN > 0
PROCESS_SUBCOMMANDS_NOW(F("G1F3000E" STRINGIFY(POWER_LOSS_UNRETRACT_LEN)));
#endif

// Additional purge on resume if configured
#if POWER_LOSS_PURGE_LEN
PROCESS_SUBCOMMANDS_NOW(TS(F("G1F3000E"), (POWER_LOSS_PURGE_LEN) + (POWER_LOSS_RETRACT_LEN)));
PROCESS_SUBCOMMANDS_NOW(TS(F("G1F3000E"), (POWER_LOSS_PURGE_LEN) + (POWER_LOSS_UNRETRACT_LEN)));
#endif

#if ENABLED(NOZZLE_CLEAN_FEATURE)
Expand Down