Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add heated chamber to power loss recovery #26696

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Marlin/src/feature/powerloss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,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
Expand Down Expand Up @@ -384,6 +386,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;
Expand Down Expand Up @@ -634,6 +642,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) {
Expand Down
3 changes: 3 additions & 0 deletions Marlin/src/feature/powerloss.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,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
Expand Down