From 97546bf55b20f10fa8952efbd232481e11e9f916 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Thu, 25 Jan 2024 09:33:02 +1300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20PLR=20recover=20chamber=20temp?= =?UTF-8?q?=20(#26696)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/powerloss.cpp | 12 ++++++++++++ Marlin/src/feature/powerloss.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/Marlin/src/feature/powerloss.cpp b/Marlin/src/feature/powerloss.cpp index 495f789f04..70fac66fce 100644 --- a/Marlin/src/feature/powerloss.cpp +++ b/Marlin/src/feature/powerloss.cpp @@ -228,6 +228,8 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW TERN_(HAS_HEATED_BED, info.target_temperature_bed = thermalManager.degTargetBed()); + TERN_(HAS_HEATED_CHAMBER, info.target_temperature_chamber = thermalManager.degTargetChamber()); + TERN_(HAS_FAN, COPY(info.fan_speed, thermalManager.fan_speed)); #if HAS_LEVELING @@ -383,6 +385,12 @@ void PrintJobRecovery::resume() { PROCESS_SUBCOMMANDS_NOW(F("M420S0")); #endif + #if HAS_HEATED_CHAMBER + // Restore the chamber temperature + const celsius_t ct = info.target_temperature_chamber; + if (ct) PROCESS_SUBCOMMANDS_NOW(TS(F("M191S"), ct)); + #endif + #if HAS_HEATED_BED // Restore the bed temperature const celsius_t bt = info.target_temperature_bed; @@ -633,6 +641,10 @@ void PrintJobRecovery::resume() { DEBUG_ECHOLNPGM("target_temperature_bed: ", info.target_temperature_bed); #endif + #if HAS_HEATED_CHAMBER + DEBUG_ECHOLNPGM("target_temperature_chamber: ", info.target_temperature_chamber); + #endif + #if HAS_FAN DEBUG_ECHOPGM("fan_speed: "); FANS_LOOP(i) { diff --git a/Marlin/src/feature/powerloss.h b/Marlin/src/feature/powerloss.h index f87691cd09..579731ffdd 100644 --- a/Marlin/src/feature/powerloss.h +++ b/Marlin/src/feature/powerloss.h @@ -87,6 +87,9 @@ typedef struct { #if HAS_HEATED_BED celsius_t target_temperature_bed; #endif + #if HAS_HEATED_CHAMBER + celsius_t target_temperature_chamber; + #endif #if HAS_FAN uint8_t fan_speed[FAN_COUNT]; #endif