Fix and improve POWER_LOSS_RECOVERY (#11187)
This commit is contained in:
@ -496,7 +496,7 @@ inline void get_serial_commands() {
|
||||
if (job_recovery_commands_count) {
|
||||
if (_enqueuecommand(job_recovery_commands[job_recovery_commands_index])) {
|
||||
++job_recovery_commands_index;
|
||||
if (!--job_recovery_commands_count) job_recovery_phase = JOB_RECOVERY_IDLE;
|
||||
if (!--job_recovery_commands_count) job_recovery_phase = JOB_RECOVERY_DONE;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -72,6 +72,9 @@ void GcodeSuite::M22() { card.release(); }
|
||||
* M23: Open a file
|
||||
*/
|
||||
void GcodeSuite::M23() {
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
card.removeJobRecoveryFile();
|
||||
#endif
|
||||
// Simplify3D includes the size, so zero out all spaces (#7227)
|
||||
for (char *fn = parser.string_arg; *fn; ++fn) if (*fn == ' ') *fn = '\0';
|
||||
card.openFile(parser.string_arg, true);
|
||||
@ -81,16 +84,22 @@ void GcodeSuite::M23() {
|
||||
* M24: Start or Resume SD Print
|
||||
*/
|
||||
void GcodeSuite::M24() {
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
card.removeJobRecoveryFile();
|
||||
#endif
|
||||
|
||||
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
||||
resume_print();
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
if (parser.seenval('S')) card.setIndex(parser.value_long());
|
||||
#endif
|
||||
|
||||
card.startFileprint();
|
||||
print_job_timer.start();
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
if (parser.seenval('T'))
|
||||
print_job_timer.resume(parser.value_long());
|
||||
else
|
||||
#endif
|
||||
print_job_timer.start();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user