mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
libtunes: (bugfix) sending a custom msg tune overrides everything
Custom msg tune can override any tune playing, regardless of the tune_override flag.
This commit is contained in:
parent
2acd431fcb
commit
f47443f283
@ -92,10 +92,13 @@ int Tunes::set_control(const tune_control_s &tune_control)
|
||||
if (tune_control.tune_id < _default_tunes_size) {
|
||||
switch (tune_control.tune_id) {
|
||||
case static_cast<int>(TuneID::CUSTOM):
|
||||
_frequency = (unsigned)tune_control.frequency;
|
||||
_duration = (unsigned)tune_control.duration;
|
||||
_silence = (unsigned)tune_control.silence;
|
||||
_using_custom_msg = true;
|
||||
if (_tune == nullptr || tune_control.tune_override) {
|
||||
_frequency = (unsigned)tune_control.frequency;
|
||||
_duration = (unsigned)tune_control.duration;
|
||||
_silence = (unsigned)tune_control.silence;
|
||||
_using_custom_msg = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// tunes that have a high priority
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user