Browse Source

Merge pull request #2460 from liamcottle/ui/startup-mute

Don't play startup tune if buzzer pref disabled
pull/2280/merge
Liam Cottle 1 month ago
committed by GitHub
parent
commit
679fb9c0ab
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      examples/companion_radio/ui-new/UITask.cpp
  2. 1
      examples/companion_radio/ui-orig/UITask.cpp
  3. 1
      src/helpers/ui/buzzer.cpp

1
examples/companion_radio/ui-new/UITask.cpp

@ -575,6 +575,7 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
#ifdef PIN_BUZZER #ifdef PIN_BUZZER
buzzer.begin(); buzzer.begin();
buzzer.quiet(_node_prefs->buzzer_quiet); buzzer.quiet(_node_prefs->buzzer_quiet);
buzzer.startup();
#endif #endif
#ifdef PIN_VIBRATION #ifdef PIN_VIBRATION

1
examples/companion_radio/ui-orig/UITask.cpp

@ -57,6 +57,7 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
#ifdef PIN_BUZZER #ifdef PIN_BUZZER
buzzer.begin(); buzzer.begin();
buzzer.quiet(_node_prefs->buzzer_quiet); buzzer.quiet(_node_prefs->buzzer_quiet);
buzzer.startup();
#endif #endif
// Initialize digital button if available // Initialize digital button if available

1
src/helpers/ui/buzzer.cpp

@ -12,7 +12,6 @@ void genericBuzzer::begin() {
quiet(false); quiet(false);
pinMode(PIN_BUZZER, OUTPUT); pinMode(PIN_BUZZER, OUTPUT);
digitalWrite(PIN_BUZZER, LOW); // need to pull low by default to avoid extreme power draw digitalWrite(PIN_BUZZER, LOW); // need to pull low by default to avoid extreme power draw
startup();
} }
void genericBuzzer::play(const char *melody) { void genericBuzzer::play(const char *melody) {

Loading…
Cancel
Save