PLR_HEAT_BED_ON_REBOOT (#26691)
Some checks failed
CI - Build Tests / Build Test (push) Waiting to run
CI - Unit Tests / Unit Test (push) Waiting to run
CI - Validate Source Files / Validate Source Files (push) Waiting to run
CI - Validate boards.h / Validate boards.h (push) Has been cancelled
CI - Validate Pins Files / Validate Pins Files (push) Has been cancelled

This commit is contained in:
Vovodroid 2025-11-28 03:27:48 +02:00 committed by GitHub
parent ac0fc603ae
commit 12ac094992
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 1 deletions

View file

@ -1795,6 +1795,8 @@
//#define POWER_LOSS_RECOVERY
#if ENABLED(POWER_LOSS_RECOVERY)
#define PLR_ENABLED_DEFAULT false // Power-Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
//#define PLR_HEAT_BED_ON_REBOOT // Heat up bed immediately on reboot to mitigate object detaching/warping.
//#define PLR_HEAT_BED_EXTRA 0 // (°C) Relative increase of bed temperature for better adhesion (limited by max temp).
//#define PLR_BED_THRESHOLD BED_MAXTEMP // (°C) Skip user confirmation at or above this bed temperature (0 to disable)
//#define POWER_LOSS_PIN 44 // Pin to detect power-loss. Set to -1 to disable default pin on boards without module, or comment to use board default.

View file

@ -141,6 +141,14 @@ bool PrintJobRecovery::check() {
return success;
}
/**
* Cancel recovery
*/
void PrintJobRecovery::cancel() {
TERN_(PLR_HEAT_BED_ON_REBOOT, set_bed_temp(false));
purge();
}
/**
* Delete the recovery file and clear the recovery data
*/
@ -366,6 +374,13 @@ void PrintJobRecovery::write() {
if (!file.close()) DEBUG_ECHOLNPGM("Power-loss file close failed.");
}
#if ENABLED(PLR_HEAT_BED_ON_REBOOT)
// Set bed temperature and wait. Called from M1000 to resume bed heating.
void PrintJobRecovery::set_bed_temp(const bool on) {
PROCESS_SUBCOMMANDS_NOW(TS(F("M190S"), on ? info.target_temperature_bed + PLR_HEAT_BED_EXTRA : 0));
}
#endif
/**
* Resume the saved print job
*/

View file

@ -201,10 +201,13 @@ class PrintJobRecovery {
static void close() { file.close(); }
static bool check();
#if ENABLED(PLR_HEAT_BED_ON_REBOOT)
static void set_bed_temp(const bool turn_on);
#endif
static void resume();
static void purge();
static void cancel() { purge(); }
static void cancel();
static void load();
static void save(const bool force=ENABLED(SAVE_EACH_CMD_MODE), const float zraise=POWER_LOSS_ZRAISE, const bool raised=false);

View file

@ -72,6 +72,9 @@ void GcodeSuite::M1000() {
const bool force_resume = TERN0(HAS_PLR_BED_THRESHOLD, recovery.bed_temp_threshold && (thermalManager.degBed() >= recovery.bed_temp_threshold));
if (!force_resume && parser.seen_test('S')) {
TERN_(PLR_HEAT_BED_ON_REBOOT, recovery.set_bed_temp(true));
#if HAS_MARLINUI_MENU
ui.goto_screen(menu_job_recovery);
#elif ENABLED(EXTENSIBLE_UI)

View file

@ -14,6 +14,7 @@ opt_set MOTHERBOARD BOARD_RAMBO \
EXTRUDERS 2 TEMP_SENSOR_0 -2 TEMP_SENSOR_1 1 TEMP_SENSOR_BED 2 \
TEMP_SENSOR_PROBE 1 TEMP_PROBE_PIN 12 \
TEMP_SENSOR_CHAMBER 3 TEMP_CHAMBER_PIN 3 HEATER_CHAMBER_PIN 45 \
PLR_HEAT_BED_EXTRA 5 PLR_BED_THRESHOLD 60 \
GRID_MAX_POINTS_X 16 BACKLASH_MEASUREMENT_FEEDRATE 600 \
AUTO_POWER_E_TEMP 80 FANMUX0_PIN 53 FIL_MOTION1_PIN 45
opt_disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN USE_WATCHDOG
@ -34,6 +35,7 @@ opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER LCD_PROGRESS_BAR LCD_PROGRESS_BAR_TE
FWRETRACT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \
PSU_CONTROL LED_POWEROFF_TIMEOUT PS_OFF_CONFIRM PS_OFF_SOUND POWER_OFF_WAIT_FOR_COOLDOWN \
POWER_LOSS_RECOVERY POWER_LOSS_PIN POWER_LOSS_STATE POWER_LOSS_RECOVER_ZHOME POWER_LOSS_ZHOME_POS \
PLR_HEAT_BED_ON_REBOOT \
SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER LIN_ADVANCE ADVANCE_K_EXTRA \
HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT HOST_STATUS_NOTIFICATIONS PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL
opt_add DEBUG_POWER_LOSS_RECOVERY