🚸 Fix, Improve Power-Loss Recovery (#22828)
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
committed by
Scott Lahteine
parent
11071c7472
commit
3e18cf2b6a
@ -2809,9 +2809,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
||||
|
||||
position = target; // Update the position
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
block->sdpos = recovery.command_sdpos();
|
||||
block->start_position = position_float.asLogical();
|
||||
#endif
|
||||
|
||||
TERN_(HAS_POSITION_FLOAT, position_float = target_float);
|
||||
TERN_(GRADIENT_MIX, mixer.gradient_control(target_float.z));
|
||||
TERN_(POWER_LOSS_RECOVERY, block->sdpos = recovery.command_sdpos());
|
||||
|
||||
return true; // Movement was accepted
|
||||
|
||||
|
@ -244,6 +244,7 @@ typedef struct block_t {
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
uint32_t sdpos;
|
||||
xyze_pos_t start_position;
|
||||
#endif
|
||||
|
||||
#if ENABLED(LASER_POWER_INLINE)
|
||||
@ -252,7 +253,7 @@ typedef struct block_t {
|
||||
|
||||
} block_t;
|
||||
|
||||
#if ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL)
|
||||
#if ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL, POWER_LOSS_RECOVERY)
|
||||
#define HAS_POSITION_FLOAT 1
|
||||
#endif
|
||||
|
||||
|
@ -2151,7 +2151,10 @@ uint32_t Stepper::block_phase_isr() {
|
||||
cutter.apply_power(current_block->cutter_power);
|
||||
#endif
|
||||
|
||||
TERN_(POWER_LOSS_RECOVERY, recovery.info.sdpos = current_block->sdpos);
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
recovery.info.sdpos = current_block->sdpos;
|
||||
recovery.info.current_position = current_block->start_position;
|
||||
#endif
|
||||
|
||||
#if ENABLED(DIRECT_STEPPING)
|
||||
if (IS_PAGE(current_block)) {
|
||||
|
Reference in New Issue
Block a user