|
@@ -118,7 +118,7 @@ void PrintJobRecovery::load() {
|
118
|
118
|
/**
|
119
|
119
|
* Save the current machine state to the power-loss recovery file
|
120
|
120
|
*/
|
121
|
|
-void PrintJobRecovery::save(const bool force/*=false*/) {
|
|
121
|
+void PrintJobRecovery::save(const bool force/*=false*/, const bool save_queue/*=true*/) {
|
122
|
122
|
|
123
|
123
|
#if SAVE_INFO_INTERVAL_MS > 0
|
124
|
124
|
static millis_t next_save_ms; // = 0
|
|
@@ -182,8 +182,8 @@ void PrintJobRecovery::save(const bool force/*=false*/) {
|
182
|
182
|
#endif
|
183
|
183
|
|
184
|
184
|
// Commands in the queue
|
|
185
|
+ info.commands_in_queue = save_queue ? commands_in_queue : 0;
|
185
|
186
|
info.cmd_queue_index_r = cmd_queue_index_r;
|
186
|
|
- info.commands_in_queue = commands_in_queue;
|
187
|
187
|
COPY(info.command_queue, command_queue);
|
188
|
188
|
|
189
|
189
|
// Elapsed print job time
|
|
@@ -332,7 +332,7 @@ void PrintJobRecovery::resume() {
|
332
|
332
|
gcode.process_subcommands_now(cmd);
|
333
|
333
|
|
334
|
334
|
// Process commands from the old pending queue
|
335
|
|
- uint8_t r = info.cmd_queue_index_r, c = info.commands_in_queue;
|
|
335
|
+ uint8_t c = info.commands_in_queue, r = info.cmd_queue_index_r;
|
336
|
336
|
for (; c--; r = (r + 1) % BUFSIZE)
|
337
|
337
|
gcode.process_subcommands_now(info.command_queue[r]);
|
338
|
338
|
|