From c9862b1502092bf1ed04b941883b4f00f627317b Mon Sep 17 00:00:00 2001 From: pepevalbe Date: Thu, 31 Mar 2016 20:18:52 +0200 Subject: [PATCH] AP_Notify: New parameter to enable/disable buzzer --- libraries/AP_Notify/AP_Notify.cpp | 7 +++++++ libraries/AP_Notify/AP_Notify.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/libraries/AP_Notify/AP_Notify.cpp b/libraries/AP_Notify/AP_Notify.cpp index 969068f2d0..be264b895b 100644 --- a/libraries/AP_Notify/AP_Notify.cpp +++ b/libraries/AP_Notify/AP_Notify.cpp @@ -41,6 +41,13 @@ const AP_Param::GroupInfo AP_Notify::var_info[] = { // @User: Advanced AP_GROUPINFO("LED_BRIGHT", 0, AP_Notify, _rgb_led_brightness, RGB_LED_HIGH), + // @Param: BUZZ_ENABLE + // @DisplayName: Buzzer enable + // @Description: Enable or disable the buzzer. Only for Linux and PX4 based boards. + // @Values: 0:Disable,1:Enable + // @User: Advanced + AP_GROUPINFO("BUZZ_ENABLE", 1, AP_Notify, _buzzer_enable, BUZZER_ON), + AP_GROUPEND }; diff --git a/libraries/AP_Notify/AP_Notify.h b/libraries/AP_Notify/AP_Notify.h index f68afe7b53..effa9f0c34 100644 --- a/libraries/AP_Notify/AP_Notify.h +++ b/libraries/AP_Notify/AP_Notify.h @@ -31,6 +31,8 @@ #define RGB_LED_LOW 1 #define RGB_LED_MEDIUM 2 #define RGB_LED_HIGH 3 +#define BUZZER_ON 1 +#define BUZZER_OFF 0 class AP_Notify { @@ -97,8 +99,10 @@ public: static const struct AP_Param::GroupInfo var_info[]; + bool buzzer_enabled() const { return _buzzer_enable; } private: static NotifyDevice* _devices[]; AP_Int8 _rgb_led_brightness; + AP_Int8 _buzzer_enable; };