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

@@ -21,16 +21,13 @@
*/
#pragma once
#include "../inc/MarlinConfig.h"
#include "../sd/cardreader.h"
#include "../module/motion.h"
#include "../libs/buzzer.h"
#include "buttons.h"
#include "../inc/MarlinConfig.h"
#if HAS_BUZZER
#include "../libs/buzzer.h"
#endif
#if ENABLED(TOUCH_SCREEN_CALIBRATION)
#include "tft_io/touch_calibration.h"
#endif
@@ -192,6 +189,9 @@ typedef bool (*statusResetFunc_t)();
//////////// MarlinUI Singleton ////////////
////////////////////////////////////////////
class MarlinUI;
extern MarlinUI ui;
class MarlinUI {
public:
@@ -225,9 +225,9 @@ public:
#endif
#if ENABLED(SOUND_MENU_ITEM)
static bool buzzer_enabled; // Initialized by settings.load()
static bool sound_on; // Initialized by settings.load()
#else
static constexpr bool buzzer_enabled = true;
static constexpr bool sound_on = true;
#endif
#if HAS_BUZZER
@@ -235,7 +235,7 @@ public:
#endif
FORCE_INLINE static void chirp() {
TERN_(HAS_CHIRP, buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ));
TERN_(HAS_CHIRP, TERN(HAS_BUZZER, buzz, BUZZ)(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ));
}
#if ENABLED(LCD_HAS_STATUS_INDICATORS)
@@ -786,8 +786,6 @@ private:
#endif
};
extern MarlinUI ui;
#define LCD_MESSAGE_F(S) ui.set_status(F(S))
#define LCD_MESSAGE(M) ui.set_status(GET_TEXT_F(M))
#define LCD_ALERTMESSAGE_F(S) ui.set_alert_status(F(S))