Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/companion_radio/ui-new/UITask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
#ifdef PIN_BUZZER
buzzer.begin();
buzzer.quiet(_node_prefs->buzzer_quiet);
if (!buzzer.isQuiet()) buzzer.startup();
#endif

#ifdef PIN_VIBRATION
Expand Down
1 change: 1 addition & 0 deletions examples/companion_radio/ui-orig/UITask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
#ifdef PIN_BUZZER
buzzer.begin();
buzzer.quiet(_node_prefs->buzzer_quiet);
if (!buzzer.isQuiet()) buzzer.startup();
#endif

// Initialize digital button if available
Expand Down
9 changes: 2 additions & 7 deletions src/helpers/ui/buzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
#include "buzzer.h"

void genericBuzzer::begin() {
// Serial.print("DBG: Setting up buzzer on pin ");
// Serial.println(PIN_BUZZER);
#ifdef PIN_BUZZER_EN
pinMode(PIN_BUZZER_EN, OUTPUT);
digitalWrite(PIN_BUZZER_EN, HIGH);
#endif

quiet(false);
pinMode(PIN_BUZZER, OUTPUT);
digitalWrite(PIN_BUZZER, LOW); // need to pull low by default to avoid extreme power draw
startup();
digitalWrite(PIN_BUZZER, LOW); // pull low to avoid extreme power draw
quiet(true);
}

void genericBuzzer::play(const char *melody) {
Expand Down