From c83567dcbabc7f7ce42fbc5cd5f0d7d19b2bbd55 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 27 Jul 2018 17:12:26 +1000 Subject: [PATCH] HAL_ChibiOS: added duration to toneAlarm_set_buzzer_tone --- libraries/AP_HAL_ChibiOS/Util.cpp | 3 ++- libraries/AP_HAL_ChibiOS/Util.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/Util.cpp b/libraries/AP_HAL_ChibiOS/Util.cpp index e7e4b2d46e..80ced9910d 100644 --- a/libraries/AP_HAL_ChibiOS/Util.cpp +++ b/libraries/AP_HAL_ChibiOS/Util.cpp @@ -153,7 +153,8 @@ bool Util::toneAlarm_init() return true; } -void Util::toneAlarm_set_buzzer_tone(float frequency, float volume) { +void Util::toneAlarm_set_buzzer_tone(float frequency, float volume, uint32_t duration_ms) +{ if (is_zero(frequency) || is_zero(volume)) { pwmDisableChannel(_toneAlarm_pwm_group.pwm_drv, _toneAlarm_pwm_group.chan); } else { diff --git a/libraries/AP_HAL_ChibiOS/Util.h b/libraries/AP_HAL_ChibiOS/Util.h index 9fb8db9c60..31b7b00867 100644 --- a/libraries/AP_HAL_ChibiOS/Util.h +++ b/libraries/AP_HAL_ChibiOS/Util.h @@ -48,7 +48,7 @@ public: #ifdef HAL_PWM_ALARM bool toneAlarm_init() override; - void toneAlarm_set_buzzer_tone(float frequency, float volume) override; + void toneAlarm_set_buzzer_tone(float frequency, float volume, uint32_t duration_ms) override; #endif private: