AP_Notify: use NTF_BUZZ_ENABLE to disable tonealarm

This commit is contained in:
Andrew Tridgell 2018-07-30 14:36:27 +10:00
parent 315a33ed10
commit 397ba488db
2 changed files with 6 additions and 0 deletions

View File

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

View File

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