SOUND_ON_DEFAULT option (#24102)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
Pauli Jokela
2022-05-12 05:23:16 +03:00
committed by GitHub
parent 11c701af9b
commit 04fe50936e
23 changed files with 80 additions and 92 deletions

View File

@@ -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