Fix PLR cancel with ExtUI (#16556)

This commit is contained in:
InsanityAutomation
2020-01-13 21:52:24 -05:00
committed by Scott Lahteine
parent 1457e40208
commit ffd8b595d1
9 changed files with 30 additions and 18 deletions

View File

@ -47,6 +47,10 @@ inline void plr_error(PGM_P const prefix) {
#endif
}
#if HAS_LCD_MENU
void lcd_power_loss_recovery_cancel();
#endif
/**
* M1000: Resume from power-loss (undocumented)
* - With 'S' go to the Resume/Cancel menu
@ -64,6 +68,16 @@ void GcodeSuite::M1000() {
SERIAL_ECHO_MSG("Resume requires LCD.");
#endif
}
else if (parser.seen('C')) {
#if HAS_LCD_MENU
lcd_power_loss_recovery_cancel();
#else
recovery.cancel();
#endif
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onPrintTimerStopped();
#endif
}
else
recovery.resume();
}

View File

@ -86,6 +86,10 @@ void GcodeSuite::M24() {
*/
void GcodeSuite::M25() {
#if ENABLED(POWER_LOSS_RECOVERY)
if (recovery.enabled) recovery.save(true, false);
#endif
// Set initial pause flag to prevent more commands from landing in the queue while we try to pause
#if ENABLED(SDSUPPORT)
if (IS_SD_PRINTING()) card.pauseSDPrint();