Save/restore Relative modes in Power-Loss Recovery (#13501)

2.0.x
Msq001 6 years ago committed by Scott Lahteine
parent c6466c23fe
commit f0d14b83bc

@ -185,6 +185,10 @@ void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=
info.retract_hop = fwretract.current_hop; info.retract_hop = fwretract.current_hop;
#endif #endif
//relative mode
info.relative_mode = relative_mode;
info.relative_modes_e = gcode.axis_relative_modes[E_AXIS];
// Commands in the queue // Commands in the queue
info.commands_in_queue = save_queue ? commands_in_queue : 0; info.commands_in_queue = save_queue ? commands_in_queue : 0;
info.cmd_queue_index_r = cmd_queue_index_r; 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); sprintf_P(cmd, PSTR("G1 F%d"), info.feedrate);
gcode.process_subcommands_now(cmd); 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 // Process commands from the old pending queue
uint8_t c = info.commands_in_queue, r = info.cmd_queue_index_r; uint8_t c = info.commands_in_queue, r = info.cmd_queue_index_r;
for (; c--; r = (r + 1) % BUFSIZE) for (; c--; r = (r + 1) % BUFSIZE)

@ -76,6 +76,9 @@ typedef struct {
#endif #endif
#endif #endif
// Relative mode
bool relative_mode, relative_modes_e;
// Command queue // Command queue
uint8_t commands_in_queue, cmd_queue_index_r; uint8_t commands_in_queue, cmd_queue_index_r;
char command_queue[BUFSIZE][MAX_CMD_SIZE]; char command_queue[BUFSIZE][MAX_CMD_SIZE];

Loading…
Cancel
Save