From 4f61ed205e47f9e7688dcdaff34b1d235f18e099 Mon Sep 17 00:00:00 2001 From: Miguel Risco-Castillo Date: Mon, 7 Aug 2023 16:16:33 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20UI=20Sound=20off/on=20with=20M30?= =?UTF-8?q?0=20E<0|1>=20(#26142)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/lcd/M300.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Marlin/src/gcode/lcd/M300.cpp b/Marlin/src/gcode/lcd/M300.cpp index 7ee811f0bdce..2658b52a7ce4 100644 --- a/Marlin/src/gcode/lcd/M300.cpp +++ b/Marlin/src/gcode/lcd/M300.cpp @@ -34,8 +34,19 @@ * * S - (Hz) The frequency of the tone. 0 for silence. * P - (ms) The duration of the tone. + * + * With SOUND_MENU_ITEM: + * E<0|1> - Mute or enable sound */ void GcodeSuite::M300() { + + #if ENABLED(SOUND_MENU_ITEM) + if (parser.seen('E')) { + ui.sound_on = parser.value_bool(); + return; + } + #endif + const uint16_t frequency = parser.ushortval('S', 260); uint16_t duration = parser.ushortval('P', 1000);