"Sound: ON/OFF" menu item (#19901)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
68ef3ac675
commit
c0b4f4eb47
@@ -74,12 +74,17 @@ constexpr uint8_t epps = ENCODER_PULSES_PER_STEP;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ENABLED(SOUND_MENU_ITEM)
|
||||
bool MarlinUI::buzzer_enabled = true;
|
||||
#endif
|
||||
|
||||
#if EITHER(PCA9632_BUZZER, USE_BEEPER)
|
||||
#include "../libs/buzzer.h" // for BUZZ() macro
|
||||
#if ENABLED(PCA9632_BUZZER)
|
||||
#include "../feature/leds/pca9632.h"
|
||||
#endif
|
||||
void MarlinUI::buzz(const long duration, const uint16_t freq) {
|
||||
if (!buzzer_enabled) return;
|
||||
#if ENABLED(PCA9632_BUZZER)
|
||||
PCA9632_buzz(duration, freq);
|
||||
#elif USE_BEEPER
|
||||
|
Reference in New Issue
Block a user