From e255e4a69fa07c194b44e242cd3d20e2dacffa9b Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Mon, 7 Feb 2022 17:24:18 -0500 Subject: [PATCH] PLR accessors for Ext UI (#23687) --- Marlin/src/lcd/extui/ui_api.cpp | 9 +++++++++ Marlin/src/lcd/extui/ui_api.h | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index f2763c893f..f44e8bf720 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -94,6 +94,10 @@ #include "../../feature/caselight.h" #endif +#if ENABLED(POWER_LOSS_RECOVERY) + #include "../../feature/powerloss.h" +#endif + #if ENABLED(BABYSTEPPING) #include "../../feature/babystep.h" #endif @@ -674,6 +678,11 @@ namespace ExtUI { #endif #endif + #if ENABLED(POWER_LOSS_RECOVERY) + bool getPowerLossRecoveryEnabled() { return recovery.enabled; } + void setPowerLossRecoveryEnabled(const bool value) { recovery.enable(value); } + #endif + #if ENABLED(LIN_ADVANCE) float getLinearAdvance_mm_mm_s(const extruder_t extruder) { return (extruder < EXTRUDERS) ? planner.extruder_advance_K[extruder - E0] : 0; diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 59b509981b..6753c53740 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -315,6 +315,11 @@ namespace ExtUI { #endif #endif + #if ENABLED(POWER_LOSS_RECOVERY) + bool getPowerLossRecoveryEnabled(); + void setPowerLossRecoveryEnabled(const bool); + #endif + #if ENABLED(PIDTEMP) float getPIDValues_Kp(const extruder_t); float getPIDValues_Ki(const extruder_t);