Fix some Power Loss Recovery behaviors (#18558)

This commit is contained in:
Jason Smith
2020-07-14 23:14:03 -07:00
committed by GitHub
parent 55e519a06f
commit 76b67d55e2
8 changed files with 168 additions and 110 deletions

View File

@@ -394,6 +394,13 @@ void disable_all_steppers() {
constexpr bool did_pause_print = false;
#endif
/**
* A Print Job exists when the timer is running or SD printing
*/
bool printJobOngoing() {
return print_job_timer.isRunning() || IS_SD_PRINTING();
}
/**
* Printing is active when the print job timer is running
*/
@@ -690,7 +697,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
// Handle Power-Loss Recovery
#if ENABLED(POWER_LOSS_RECOVERY) && PIN_EXISTS(POWER_LOSS)
recovery.outage();
if (printJobOngoing()) recovery.outage();
#endif
// Run StallGuard endstop checks