mirror of https://github.com/ArduPilot/ardupilot
AP_Notify: add support for alternate alarm function
enable alarm based on pwm
This commit is contained in:
parent
7d5c493db5
commit
9cec88818e
|
@ -354,7 +354,7 @@ void AP_Notify::add_backends(void)
|
||||||
// ChibiOS noise makers
|
// ChibiOS noise makers
|
||||||
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
|
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
|
||||||
ADD_BACKEND(new Buzzer());
|
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());
|
ADD_BACKEND(new AP_ToneAlarm());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ bool AP_ToneAlarm::init()
|
||||||
if (pNotify->buzzer_enabled() == false) {
|
if (pNotify->buzzer_enabled() == false) {
|
||||||
return 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_LINUX || \
|
||||||
CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
||||||
if (!hal.util->toneAlarm_init(pNotify->get_buzzer_types())) {
|
if (!hal.util->toneAlarm_init(pNotify->get_buzzer_types())) {
|
||||||
|
|
Loading…
Reference in New Issue