Skip to content

Commit aa6ec82

Browse files
mriscocPragma8123
authored andcommitted
🚸 UI Sound off/on with M300 E<0|1> (MarlinFirmware#26142)
1 parent c1a235d commit aa6ec82

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Marlin/src/gcode/lcd/M300.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,19 @@
3434
*
3535
* S<frequency> - (Hz) The frequency of the tone. 0 for silence.
3636
* P<duration> - (ms) The duration of the tone.
37+
*
38+
* With SOUND_MENU_ITEM:
39+
* E<0|1> - Mute or enable sound
3740
*/
3841
void GcodeSuite::M300() {
42+
43+
#if ENABLED(SOUND_MENU_ITEM)
44+
if (parser.seen('E')) {
45+
ui.sound_on = parser.value_bool();
46+
return;
47+
}
48+
#endif
49+
3950
const uint16_t frequency = parser.ushortval('S', 260);
4051
uint16_t duration = parser.ushortval('P', 1000);
4152

0 commit comments

Comments
 (0)