mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 03:03:33 +08:00
libtunes: Repeating tunes can be interrupted without override
Otherwise the only way of interrupting a repeated tune would be with the override flag, which should only be used rarely. Now repeating tunes have lowest priority, followed by one-shot tunes, followed by anything with an override flag.
This commit is contained in:
committed by
Beat Küng
parent
34836a2b21
commit
d455c1e7e1
@@ -88,7 +88,15 @@ void Tunes::config_tone(bool repeat_flag)
|
||||
int Tunes::set_control(const tune_control_s &tune_control)
|
||||
{
|
||||
bool reset_playing_tune = false;
|
||||
_repeat = false;
|
||||
|
||||
// Only reset these flags if the new tune will actually be played.
|
||||
// Note that repeated tunes can always be interrupted, even without the
|
||||
// override flag.
|
||||
if (_repeat || _tune == nullptr || tune_control.tune_override) {
|
||||
_repeat = false;
|
||||
_using_custom_msg = false;
|
||||
_tune = nullptr;
|
||||
}
|
||||
|
||||
if (tune_control.tune_id < _default_tunes_size) {
|
||||
switch (tune_control.tune_id) {
|
||||
|
||||
Reference in New Issue
Block a user