committed by
Scott Lahteine
parent
b6c37960e8
commit
2690bb1bc2
@ -79,20 +79,39 @@ void GcodeSuite::M81() {
|
||||
|
||||
print_job_timer.stop();
|
||||
|
||||
#if HAS_FAN
|
||||
#if ENABLED(PROBING_FANS_OFF)
|
||||
thermalManager.fans_paused = false;
|
||||
ZERO(thermalManager.saved_fan_speed);
|
||||
#endif
|
||||
#if BOTH(HAS_FAN, PROBING_FANS_OFF)
|
||||
thermalManager.fans_paused = false;
|
||||
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')) {
|
||||
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
|
||||
|
||||
#if ENABLED(POWER_OFF_WAIT_FOR_COOLDOWN)
|
||||
if (parser.boolval('S')) {
|
||||
delayed_power_off = true;
|
||||
powerManager.setPowerOffOnCooldown(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (delayed_power_off) return;
|
||||
|
||||
#if HAS_SUICIDE
|
||||
suicide();
|
||||
#elif ENABLED(PSU_CONTROL)
|
||||
powerManager.power_off_soon();
|
||||
#endif
|
||||
|
||||
LCD_MESSAGE_F(MACHINE_NAME " " STR_OFF ".");
|
||||
}
|
||||
|
Reference in New Issue
Block a user