✨ SOUND_ON_DEFAULT option (#24102)
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "../inc/MarlinConfig.h"
|
||||
|
||||
#if USE_BEEPER
|
||||
#if HAS_BEEPER
|
||||
|
||||
#include "circularqueue.h"
|
||||
|
||||
@@ -61,18 +61,6 @@
|
||||
*/
|
||||
FORCE_INLINE static void invert() { TOGGLE(BEEPER_PIN); }
|
||||
|
||||
/**
|
||||
* @brief Turn off a digital PIN
|
||||
* @details Alias of digitalWrite(PIN, LOW) using FastIO
|
||||
*/
|
||||
FORCE_INLINE static void off() { WRITE(BEEPER_PIN, LOW); }
|
||||
|
||||
/**
|
||||
* @brief Turn on a digital PIN
|
||||
* @details Alias of digitalWrite(PIN, HIGH) using FastIO
|
||||
*/
|
||||
FORCE_INLINE static void on() { WRITE(BEEPER_PIN, HIGH); }
|
||||
|
||||
/**
|
||||
* @brief Resets the state of the class
|
||||
* @details Brings the class state to a known one.
|
||||
@@ -91,6 +79,20 @@
|
||||
reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turn on a digital PIN
|
||||
* @details Alias of digitalWrite(PIN, HIGH) using FastIO
|
||||
*/
|
||||
FORCE_INLINE static void on() { WRITE(BEEPER_PIN, HIGH); }
|
||||
|
||||
/**
|
||||
* @brief Turn off a digital PIN
|
||||
* @details Alias of digitalWrite(PIN, LOW) using FastIO
|
||||
*/
|
||||
FORCE_INLINE static void off() { WRITE(BEEPER_PIN, LOW); }
|
||||
|
||||
static void click(const uint16_t duration) { on(); delay(duration); off(); }
|
||||
|
||||
/**
|
||||
* @brief Add a tone to the queue
|
||||
* @details Adds a tone_t structure to the ring buffer, will block IO if the
|
||||
@@ -118,8 +120,8 @@
|
||||
#elif HAS_BUZZER
|
||||
|
||||
// Buzz indirectly via the MarlinUI instance
|
||||
#include "../lcd/marlinui.h"
|
||||
#define BUZZ(d,f) ui.buzz(d,f)
|
||||
#include "../lcd/marlinui.h"
|
||||
|
||||
#else
|
||||
|
||||
|
||||
Reference in New Issue
Block a user