🧑‍💻 ExtUI::onPowerLoss

This commit is contained in:
Scott Lahteine
2023-02-19 11:41:50 -06:00
parent 786c666151
commit c950f0f5d1
12 changed files with 45 additions and 6 deletions

View File

@@ -31,6 +31,10 @@
#include "powerloss.h"
#include "../core/macros.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extui/ui_api.h"
#endif
bool PrintJobRecovery::enabled; // Initialized by settings.load()
MediaFile PrintJobRecovery::file;
@@ -313,6 +317,9 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW
// and a flag whether the raise was already done here.
if (IS_SD_PRINTING()) save(true, zraise, ENABLED(BACKUP_POWER_SUPPLY));
// Tell the LCD about the outage, even though it is about to die
TERN_(EXTENSIBLE_UI, ExtUI::onPowerLoss());
// Disable all heaters to reduce power loss
thermalManager.disable_all_heaters();