diff --git a/Marlin/src/feature/power_loss_recovery.cpp b/Marlin/src/feature/power_loss_recovery.cpp index ba434116d2..a30dffa458 100644 --- a/Marlin/src/feature/power_loss_recovery.cpp +++ b/Marlin/src/feature/power_loss_recovery.cpp @@ -185,6 +185,10 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*= info.retract_hop = fwretract.current_hop; #endif + //relative mode + info.relative_mode = relative_mode; + info.relative_modes_e = gcode.axis_relative_modes[E_AXIS]; + // Commands in the queue info.commands_in_queue = save_queue ? commands_in_queue : 0; info.cmd_queue_index_r = cmd_queue_index_r; @@ -339,6 +343,10 @@ void PrintJobRecovery::resume() { sprintf_P(cmd, PSTR("G1 F%d"), info.feedrate); gcode.process_subcommands_now(cmd); + //relative mode + if (info.relative_mode) relative_mode = true; + if (info.relative_modes_e) gcode.axis_relative_modes[E_AXIS] = true; + // Process commands from the old pending queue uint8_t c = info.commands_in_queue, r = info.cmd_queue_index_r; for (; c--; r = (r + 1) % BUFSIZE) diff --git a/Marlin/src/feature/power_loss_recovery.h b/Marlin/src/feature/power_loss_recovery.h index dd330652ea..c2f8687711 100644 --- a/Marlin/src/feature/power_loss_recovery.h +++ b/Marlin/src/feature/power_loss_recovery.h @@ -76,6 +76,9 @@ typedef struct { #endif #endif + // Relative mode + bool relative_mode, relative_modes_e; + // Command queue uint8_t commands_in_queue, cmd_queue_index_r; char command_queue[BUFSIZE][MAX_CMD_SIZE];