Fix erroneous power off message when function is called with no action

This commit is contained in:
InsanityAutomation
2023-03-26 19:20:39 -04:00
parent 01479cab84
commit d873148f2f
+2 -1
View File
@@ -98,11 +98,12 @@ void Power::power_on() {
* Processes any PSU_POWEROFF_GCODE and makes a PS_OFF_SOUND if enabled.
*/
void Power::power_off() {
SERIAL_ECHOLNPGM(STR_POWEROFF);
TERN_(HAS_SUICIDE, suicide());
if (!psu_on) return;
SERIAL_ECHOLNPGM(STR_POWEROFF);
#ifdef PSU_POWEROFF_GCODE
gcode.process_subcommands_now(F(PSU_POWEROFF_GCODE));