mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Notify: add and use AP_NOTIFY_TONEALARM_ENABLED
This commit is contained in:
parent
6933000395
commit
dfcadfc618
@ -374,7 +374,7 @@ void AP_Notify::add_backends(void)
|
||||
// ChibiOS noise makers
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
|
||||
ADD_BACKEND(new Buzzer());
|
||||
#if HAL_PWM_COUNT > 0 || HAL_DSHOT_ALARM_ENABLED
|
||||
#if AP_NOTIFY_TONEALARM_ENABLED
|
||||
ADD_BACKEND(new AP_ToneAlarm());
|
||||
#endif
|
||||
|
||||
|
@ -48,3 +48,7 @@
|
||||
#ifndef AP_NOTIFY_NEOPIXEL_ENABLED
|
||||
#define AP_NOTIFY_NEOPIXEL_ENABLED AP_NOTIFY_SERIALLED_ENABLED
|
||||
#endif
|
||||
|
||||
#ifndef AP_NOTIFY_TONEALARM_ENABLED
|
||||
#define AP_NOTIFY_TONEALARM_ENABLED ((defined(HAL_PWM_ALARM) || HAL_DSHOT_ALARM_ENABLED))
|
||||
#endif
|
||||
|
@ -105,9 +105,7 @@ bool AP_ToneAlarm::init()
|
||||
if (pNotify->buzzer_enabled() == false) {
|
||||
return false;
|
||||
}
|
||||
#if ((defined(HAL_PWM_ALARM) || defined(HAL_PWM_ALT_ALARM) || HAL_DSHOT_ALARM_ENABLED) && CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS) || \
|
||||
CONFIG_HAL_BOARD == HAL_BOARD_LINUX || \
|
||||
CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
||||
#if AP_NOTIFY_TONEALARM_ENABLED
|
||||
if (!hal.util->toneAlarm_init(pNotify->get_buzzer_types())) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user