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())) {