diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index 480cb91a91..0e4d5452e4 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -153,6 +153,7 @@ void Power::power_off() { } void Power::checkAutoPowerOff() { + if (TERN1(POWER_OFF_TIMER, !power_off_time) && TERN1(POWER_OFF_WAIT_FOR_COOLDOWN, !power_off_on_cooldown)) return; if (TERN0(POWER_OFF_WAIT_FOR_COOLDOWN, power_off_on_cooldown && is_cooling_needed())) return; if (TERN0(POWER_OFF_TIMER, power_off_time && PENDING(millis(), power_off_time))) return; power_off(); diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index dc9b09c4e1..cbb3c85f40 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -84,14 +84,19 @@ void GcodeSuite::M81() { ZERO(thermalManager.saved_fan_speed); #endif + safe_delay(1000); // Wait 1 second before switching off + LCD_MESSAGE_F(MACHINE_NAME " " STR_OFF "."); bool delayed_power_off = false; #if ENABLED(POWER_OFF_TIMER) if (parser.seenval('D')) { - delayed_power_off = true; - powerManager.setPowerOffTimer(SEC_TO_MS(parser.value_ushort())); + uint16_t delay = parser.value_ushort(); + if (delay > 1) { // skip already observed 1s delay + delayed_power_off = true; + powerManager.setPowerOffTimer(SEC_TO_MS(delay - 1)); + } } #endif @@ -104,8 +109,6 @@ void GcodeSuite::M81() { if (delayed_power_off) return; - safe_delay(1000); // Wait 1 second before switching off - #if HAS_SUICIDE suicide(); #elif ENABLED(PSU_CONTROL)