Merge upstream changes from Marlin 2.1.1
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include "../../module/temperature.h"
|
||||
#include "../../module/planner.h" // for planner.finish_and_disable
|
||||
#include "../../module/printcounter.h" // for print_job_timer.stop
|
||||
#include "../../lcd/marlinui.h" // for LCD_MESSAGEPGM_P
|
||||
#include "../../lcd/marlinui.h" // for LCD_MESSAGE_F
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
// S: Report the current power supply state and exit
|
||||
if (parser.seen('S')) {
|
||||
SERIAL_ECHOPGM_P(powerManager.psu_on ? PSTR("PS:1\n") : PSTR("PS:0\n"));
|
||||
SERIAL_ECHOF(powerManager.psu_on ? F("PS:1\n") : F("PS:0\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
#endif
|
||||
// PATCH END: Knutwurst
|
||||
|
||||
TERN_(HAS_LCD_MENU, ui.reset_status());
|
||||
TERN_(HAS_MARLINUI_MENU, ui.reset_status());
|
||||
}
|
||||
|
||||
#endif // PSU_CONTROL
|
||||
@@ -86,26 +86,47 @@
|
||||
* This code should ALWAYS be available for FULL SHUTDOWN!
|
||||
*/
|
||||
void GcodeSuite::M81() {
|
||||
thermalManager.disable_all_heaters();
|
||||
planner.finish_and_disable();
|
||||
thermalManager.cooldown();
|
||||
|
||||
print_job_timer.stop();
|
||||
|
||||
#if HAS_FAN
|
||||
thermalManager.zero_fan_speeds();
|
||||
#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) {
|
||||
SERIAL_ECHOLNPGM(STR_DELAYED_POWEROFF);
|
||||
return;
|
||||
}
|
||||
|
||||
#if HAS_SUICIDE
|
||||
suicide();
|
||||
#elif ENABLED(PSU_CONTROL)
|
||||
powerManager.power_off_soon();
|
||||
#endif
|
||||
|
||||
LCD_MESSAGEPGM_P(PSTR(MACHINE_NAME " " STR_OFF "."));
|
||||
}
|
||||
|
Reference in New Issue
Block a user