Skip to content

Commit

Permalink
🚸 UI Sound off/on with M300 E<0|1> (MarlinFirmware#26142)
Browse files Browse the repository at this point in the history
  • Loading branch information
mriscoc authored and EvilGremlin committed Oct 26, 2023
1 parent 649846b commit 4f61ed2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Marlin/src/gcode/lcd/M300.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,19 @@
*
* S<frequency> - (Hz) The frequency of the tone. 0 for silence.
* P<duration> - (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);

Expand Down

0 comments on commit 4f61ed2

Please sign in to comment.