AP_Notify: add support for alternate alarm function

enable alarm based on pwm
This commit is contained in:
Andy Piper 2022-02-12 21:56:06 +00:00 committed by Andrew Tridgell
parent 7d5c493db5
commit 9cec88818e
2 changed files with 2 additions and 2 deletions

View File

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

View File

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