"Sound: ON/OFF" menu item (#19901)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Lucas Seiki Oshiro
2020-10-27 22:41:12 -03:00
committed by GitHub
parent 68ef3ac675
commit c0b4f4eb47
13 changed files with 74 additions and 13 deletions

View File

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