From 9cec88818e91e290dee15f4637f9af38587059b5 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Sat, 12 Feb 2022 21:56:06 +0000 Subject: [PATCH] AP_Notify: add support for alternate alarm function enable alarm based on pwm --- libraries/AP_Notify/AP_Notify.cpp | 2 +- libraries/AP_Notify/ToneAlarm.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Notify/AP_Notify.cpp b/libraries/AP_Notify/AP_Notify.cpp index 9bcf2dae00..a3998df85b 100644 --- a/libraries/AP_Notify/AP_Notify.cpp +++ b/libraries/AP_Notify/AP_Notify.cpp @@ -354,7 +354,7 @@ void AP_Notify::add_backends(void) // ChibiOS noise makers #if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS ADD_BACKEND(new Buzzer()); -#if defined(HAL_PWM_ALARM) || HAL_DSHOT_ALARM +#if HAL_USE_PWM == TRUE || HAL_DSHOT_ALARM ADD_BACKEND(new AP_ToneAlarm()); #endif diff --git a/libraries/AP_Notify/ToneAlarm.cpp b/libraries/AP_Notify/ToneAlarm.cpp index cf5f66c05a..e2b5c4f790 100644 --- a/libraries/AP_Notify/ToneAlarm.cpp +++ b/libraries/AP_Notify/ToneAlarm.cpp @@ -105,7 +105,7 @@ bool AP_ToneAlarm::init() if (pNotify->buzzer_enabled() == false) { return false; } -#if ((defined(HAL_PWM_ALARM) || HAL_DSHOT_ALARM) && CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS) || \ +#if ((defined(HAL_PWM_ALARM) || defined(HAL_PWM_ALT_ALARM) || HAL_DSHOT_ALARM) && CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS) || \ CONFIG_HAL_BOARD == HAL_BOARD_LINUX || \ CONFIG_HAL_BOARD == HAL_BOARD_SITL if (!hal.util->toneAlarm_init(pNotify->get_buzzer_types())) {