diff --git a/libraries/AP_Notify/ToneAlarm_PX4.cpp b/libraries/AP_Notify/ToneAlarm_PX4.cpp index e74f5dab9e..bd1ed9ce20 100644 --- a/libraries/AP_Notify/ToneAlarm_PX4.cpp +++ b/libraries/AP_Notify/ToneAlarm_PX4.cpp @@ -277,8 +277,12 @@ void ToneAlarm_PX4::update() flags.pre_arm_check = AP_Notify::flags.pre_arm_check; if (flags.pre_arm_check) { play_tone(AP_NOTIFY_PX4_TONE_QUIET_READY_OR_FINISHED); + _have_played_ready_tone = true; } else { - play_tone(AP_NOTIFY_PX4_TONE_QUIET_NOT_READY_OR_NOT_FINISHED); + // only play sad tone if we've ever played happy tone: + if (_have_played_ready_tone) { + play_tone(AP_NOTIFY_PX4_TONE_QUIET_NOT_READY_OR_NOT_FINISHED); + } } } diff --git a/libraries/AP_Notify/ToneAlarm_PX4.h b/libraries/AP_Notify/ToneAlarm_PX4.h index 13eaa4f751..565388c422 100644 --- a/libraries/AP_Notify/ToneAlarm_PX4.h +++ b/libraries/AP_Notify/ToneAlarm_PX4.h @@ -62,6 +62,7 @@ private: uint16_t leak_detected : 1; // 1 if leak detected uint16_t powering_off : 1; // 1 if smart battery is powering off } flags; + bool _have_played_ready_tone : 1; int8_t _cont_tone_playing; int8_t _tone_playing;