mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_Notify: only play not-ready-or-not-finished tone if we've been ready
This commit is contained in:
parent
c436235b05
commit
23882aaab0
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user