diff --git a/libraries/AP_Notify/AP_Notify.h b/libraries/AP_Notify/AP_Notify.h index 8b67a42b72..13740cd12d 100644 --- a/libraries/AP_Notify/AP_Notify.h +++ b/libraries/AP_Notify/AP_Notify.h @@ -87,6 +87,9 @@ public: uint16_t compass_cal_saved : 1; // 1 when compass calibration was just saved uint16_t compass_cal_failed : 1; // 1 when compass calibration has just failed uint16_t compass_cal_canceled : 1; // 1 when compass calibration was just canceled + uint16_t tune_started : 1; // tuning a parameter has started + uint16_t tune_next : 1; // tuning switched to next parameter + uint16_t tune_save : 1; // tuning saved parameters }; // the notify flags are static to allow direct class access diff --git a/libraries/AP_Notify/ToneAlarm_PX4.cpp b/libraries/AP_Notify/ToneAlarm_PX4.cpp index e66b971aeb..debbda738f 100644 --- a/libraries/AP_Notify/ToneAlarm_PX4.cpp +++ b/libraries/AP_Notify/ToneAlarm_PX4.cpp @@ -296,6 +296,19 @@ void ToneAlarm_PX4::update() stop_cont_tone(); } } + + if (AP_Notify::events.tune_started) { + play_tone(AP_NOTIFY_PX4_TONE_LOUD_NEU_FEEDBACK); + AP_Notify::events.tune_started = 0; + } + if (AP_Notify::events.tune_next) { + play_tone(AP_NOTIFY_PX4_TONE_LOUD_POS_FEEDBACK); + AP_Notify::events.tune_next = 0; + } + if (AP_Notify::events.tune_save) { + play_tone(AP_NOTIFY_PX4_TONE_QUIET_READY_OR_FINISHED); + AP_Notify::events.tune_save = 0; + } } #endif // CONFIG_HAL_BOARD == HAL_BOARD_PX4