|
@ -118,7 +118,7 @@ void PrintJobRecovery::load() { |
|
|
/**
|
|
|
/**
|
|
|
* Save the current machine state to the power-loss recovery file |
|
|
* Save the current machine state to the power-loss recovery file |
|
|
*/ |
|
|
*/ |
|
|
void PrintJobRecovery::save(const bool force/*=false*/) { |
|
|
void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=true*/) { |
|
|
|
|
|
|
|
|
#if SAVE_INFO_INTERVAL_MS > 0 |
|
|
#if SAVE_INFO_INTERVAL_MS > 0 |
|
|
static millis_t next_save_ms; // = 0
|
|
|
static millis_t next_save_ms; // = 0
|
|
@ -182,8 +182,8 @@ void PrintJobRecovery::save(const bool force/*=false*/) { |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
// Commands in the queue
|
|
|
// Commands in the queue
|
|
|
|
|
|
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; |
|
|
info.commands_in_queue = commands_in_queue; |
|
|
|
|
|
COPY(info.command_queue, command_queue); |
|
|
COPY(info.command_queue, command_queue); |
|
|
|
|
|
|
|
|
// Elapsed print job time
|
|
|
// Elapsed print job time
|
|
@ -332,7 +332,7 @@ void PrintJobRecovery::resume() { |
|
|
gcode.process_subcommands_now(cmd); |
|
|
gcode.process_subcommands_now(cmd); |
|
|
|
|
|
|
|
|
// Process commands from the old pending queue
|
|
|
// Process commands from the old pending queue
|
|
|
uint8_t r = info.cmd_queue_index_r, c = info.commands_in_queue; |
|
|
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) |
|
|
gcode.process_subcommands_now(info.command_queue[r]); |
|
|
gcode.process_subcommands_now(info.command_queue[r]); |
|
|
|
|
|
|
|
|