Skip to content

Commit ed1391e

Browse files
authored
🔧 Wrap POWER_LOSS_RETRACT_LEN (MarlinFirmware#26695)
1 parent 7fbd9ec commit ed1391e

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

Marlin/Configuration_adv.h

+14-8
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@
459459
#define PID_FAN_SCALING_LIN_FACTOR (PID_FAN_SCALING_AT_FULL_SPEED-DEFAULT_Kf)/255.0
460460

461461
#else
462-
#define PID_FAN_SCALING_LIN_FACTOR (0) // Power loss due to cooling = Kf * (fan_speed)
462+
#define PID_FAN_SCALING_LIN_FACTOR (0) // Power-loss due to cooling = Kf * (fan_speed)
463463
#define DEFAULT_Kf 10 // A constant value added to the PID-tuner
464464
#define PID_FAN_SCALING_MIN_SPEED 10 // Minimum fan speed at which to enable PID_FAN_SCALING
465465
#endif
@@ -1540,6 +1540,7 @@
15401540
* Axis moves <= 1/2 the axis length and Extruder moves <= EXTRUDE_MAXLENGTH
15411541
* will be shown in the move submenus.
15421542
*/
1543+
15431544
#define MANUAL_MOVE_DISTANCE_MM 10, 1.0, 0.1 // (mm)
15441545
//#define MANUAL_MOVE_DISTANCE_MM 100, 50, 10, 1.0, 0.1 // (mm)
15451546
//#define MANUAL_MOVE_DISTANCE_MM 500, 100, 50, 10, 1.0, 0.1 // (mm)
@@ -1744,21 +1745,26 @@
17441745
*/
17451746
//#define POWER_LOSS_RECOVERY
17461747
#if ENABLED(POWER_LOSS_RECOVERY)
1747-
#define PLR_ENABLED_DEFAULT false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
1748+
#define PLR_ENABLED_DEFAULT false // Power-Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
17481749
//#define PLR_BED_THRESHOLD BED_MAXTEMP // (°C) Skip user confirmation at or above this bed temperature (0 to disable)
1749-
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power loss
1750-
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power loss with UPS)
1751-
//#define POWER_LOSS_PIN 44 // Pin to detect power loss. Set to -1 to disable default pin on boards without module.
1752-
//#define POWER_LOSS_STATE HIGH // State of pin indicating power loss
1750+
1751+
//#define POWER_LOSS_PIN 44 // Pin to detect power-loss. Set to -1 to disable default pin on boards without module, or comment to use board default.
1752+
//#define POWER_LOSS_STATE HIGH // State of pin indicating power-loss
17531753
//#define POWER_LOSS_PULLUP // Set pullup / pulldown as appropriate for your sensor
17541754
//#define POWER_LOSS_PULLDOWN
1755-
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
1756-
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail. Requires backup power.
1755+
1756+
//#define POWER_LOSS_ZRAISE 2 // (mm) Z axis raise on resume (on power-loss with UPS)
1757+
//#define POWER_LOSS_PURGE_LEN 20 // (mm) Length of filament to purge on resume
17571758

17581759
// Without a POWER_LOSS_PIN the following option helps reduce wear on the SD card,
17591760
// especially with "vase mode" printing. Set too high and vases cannot be continued.
17601761
#define POWER_LOSS_MIN_Z_CHANGE 0.05 // (mm) Minimum Z change before saving power-loss data
17611762

1763+
//#define BACKUP_POWER_SUPPLY // Backup power / UPS to move the steppers on power-loss
1764+
#if ENABLED(BACKUP_POWER_SUPPLY)
1765+
//#define POWER_LOSS_RETRACT_LEN 10 // (mm) Length of filament to retract on fail
1766+
#endif
1767+
17621768
// Enable if Z homing is needed for proper recovery. 99.9% of the time this should be disabled!
17631769
//#define POWER_LOSS_RECOVER_ZHOME
17641770
#if ENABLED(POWER_LOSS_RECOVER_ZHOME)

Marlin/src/feature/powerloss.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,15 @@ uint32_t PrintJobRecovery::cmd_sdpos, // = 0
7575

7676
PrintJobRecovery recovery;
7777

78-
#ifndef POWER_LOSS_PURGE_LEN
79-
#define POWER_LOSS_PURGE_LEN 0
80-
#endif
81-
8278
#if DISABLED(BACKUP_POWER_SUPPLY)
8379
#undef POWER_LOSS_RETRACT_LEN // No retract at outage without backup power
8480
#endif
8581
#ifndef POWER_LOSS_RETRACT_LEN
8682
#define POWER_LOSS_RETRACT_LEN 0
8783
#endif
84+
#ifndef POWER_LOSS_PURGE_LEN
85+
#define POWER_LOSS_PURGE_LEN 0
86+
#endif
8887

8988
// Allow power-loss recovery to be aborted
9089
#define PLR_CAN_ABORT

Marlin/src/feature/powerloss.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@
4242
#define POWER_LOSS_STATE HIGH
4343
#endif
4444

45+
#if DISABLED(BACKUP_POWER_SUPPLY)
46+
#undef POWER_LOSS_ZRAISE // No Z raise at outage without backup power
47+
#endif
4548
#ifndef POWER_LOSS_ZRAISE
46-
#define POWER_LOSS_ZRAISE 2
49+
#define POWER_LOSS_ZRAISE 2 // Default Z-raise on outage or resume
4750
#endif
4851

4952
//#define DEBUG_POWER_LOSS_RECOVERY

0 commit comments

Comments
 (0)