Skip to content

Commit d77e921

Browse files
committed
✨ STARTUP_TUNE option
1 parent 756fd1b commit d77e921

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Marlin/src/MarlinCore.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,11 @@ void setup() {
16601660

16611661
marlin_state = MF_RUNNING;
16621662

1663+
#if ENABLED(SPEAKER) && defined(STARTUP_TUNE)
1664+
constexpr uint16_t tune[] = STARTUP_TUNE;
1665+
for (uint8_t i = 0; i < COUNT(tune); i += 2) BUZZ(tune[i + 1], tune[i]);
1666+
#endif
1667+
16631668
SETUP_LOG("setup() completed.");
16641669

16651670
TERN_(MARLIN_TEST_BUILD, runStartupTests());

Marlin/src/gcode/lcd/M300.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@
3030
#include "../../libs/buzzer.h" // Buzzer, if possible
3131

3232
/**
33-
* M300: Play beep sound S<frequency Hz> P<duration ms>
33+
* M300: Play a Tone / Add a tone to the queue
34+
*
35+
* S<frequency> - (Hz) The frequency of the tone. 0 for silence.
36+
* P<duration> - (ms) The duration of the tone.
3437
*/
3538
void GcodeSuite::M300() {
36-
uint16_t const frequency = parser.ushortval('S', 260);
39+
const uint16_t frequency = parser.ushortval('S', 260);
3740
uint16_t duration = parser.ushortval('P', 1000);
3841

3942
// Limits the tone duration to 0-5 seconds.

0 commit comments

Comments
 (0)