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

@ -702,6 +702,7 @@ void DGUSScreenVariableHandler::HandleMotorLockUnlock(DGUS_VP_Variable &var, voi
}
#if ENABLED(POWER_LOSS_RECOVERY)
void DGUSScreenVariableHandler::HandlePowerLossRecovery(DGUS_VP_Variable &var, void *val_ptr) {
uint16_t value = swap16(*(uint16_t*)val_ptr);
if (value) {
@ -709,11 +710,11 @@ void DGUSScreenVariableHandler::HandleMotorLockUnlock(DGUS_VP_Variable &var, voi
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_SDPRINTMANIPULATION);
}
else {
card.removeJobRecoveryFile();
card.autostart_index = 0;
recovery.cancel();
ScreenHandler.GotoScreen(DGUSLCD_SCREEN_STATUS);
}
}
#endif
void DGUSScreenVariableHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) {

View File

@ -39,8 +39,7 @@ static void lcd_power_loss_recovery_resume() {
}
void lcd_power_loss_recovery_cancel() {
card.removeJobRecoveryFile();
card.autostart_index = 0;
recovery.cancel();
ui.return_to_status();
}

View File

@ -95,10 +95,6 @@ MarlinUI ui;
#include "../module/planner.h"
#include "../module/motion.h"
#if ENABLED(POWER_LOSS_RECOVERY)
#include "../feature/power_loss_recovery.h"
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "../feature/bedlevel/bedlevel.h"
#endif
@ -1519,10 +1515,6 @@ void MarlinUI::update() {
synchronize(GET_TEXT(MSG_PAUSE_PRINT));
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
if (recovery.enabled) recovery.save(true, false);
#endif
#if ENABLED(HOST_PROMPT_SUPPORT)
host_prompt_open(PROMPT_PAUSE_RESUME, PSTR("UI Pause"), PSTR("Resume"));
#endif