From f399706911ac26bee8af5535f6714be100af73a0 Mon Sep 17 00:00:00 2001 From: Cytown Date: Sat, 26 Jun 2021 03:50:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Power-off=20tone=20followup=20(#?= =?UTF-8?q?22222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/power.cpp | 9 +++++++++ Marlin/src/gcode/control/M80_M81.cpp | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index fb2f1312e0..e7d33bec49 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/power.cpp @@ -33,6 +33,10 @@ #include "../module/stepper/indirection.h" #include "../MarlinCore.h" +#if ENABLED(PS_OFF_SOUND) + #include "../libs/buzzer.h" +#endif + #if defined(PSU_POWERUP_GCODE) || defined(PSU_POWEROFF_GCODE) #include "../gcode/gcode.h" #endif @@ -133,6 +137,11 @@ void Power::power_off() { #ifdef PSU_POWEROFF_GCODE GcodeSuite::process_subcommands_now_P(PSTR(PSU_POWEROFF_GCODE)); #endif + + #if ENABLED(PS_OFF_SOUND) + BUZZ(1000, 659); + #endif + PSU_PIN_OFF(); } } diff --git a/Marlin/src/gcode/control/M80_M81.cpp b/Marlin/src/gcode/control/M80_M81.cpp index 00a0a31026..1b5ea2f7ef 100644 --- a/Marlin/src/gcode/control/M80_M81.cpp +++ b/Marlin/src/gcode/control/M80_M81.cpp @@ -101,10 +101,6 @@ void GcodeSuite::M81() { #endif #endif - #if ENABLED(PS_OFF_SOUND) - BUZZ(1000, 659); - #endif - safe_delay(1000); // Wait 1 second before switching off #if HAS_SUICIDE