Browse Source

AP_Notify: use NTF_BUZZ_ENABLE to disable tonealarm

master
Andrew Tridgell 7 years ago
parent
commit
397ba488db
  1. 3
      libraries/AP_Notify/Buzzer.cpp
  2. 3
      libraries/AP_Notify/ToneAlarm.cpp

3
libraries/AP_Notify/Buzzer.cpp

@ -33,6 +33,9 @@ extern const AP_HAL::HAL& hal; @@ -33,6 +33,9 @@ extern const AP_HAL::HAL& hal;
bool Buzzer::init()
{
if (pNotify->buzzer_enabled() == false) {
return false;
}
#if defined(HAL_BUZZER_PIN)
_pin = HAL_BUZZER_PIN;
#else

3
libraries/AP_Notify/ToneAlarm.cpp

@ -93,6 +93,9 @@ const AP_ToneAlarm::Tone AP_ToneAlarm::_tones[] { @@ -93,6 +93,9 @@ const AP_ToneAlarm::Tone AP_ToneAlarm::_tones[] {
bool AP_ToneAlarm::init()
{
if (pNotify->buzzer_enabled() == false) {
return false;
}
if (!hal.util->toneAlarm_init()) {
return false;
}

Loading…
Cancel
Save