mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
tunes: don't let tune interrupt itself
This commit is contained in:
committed by
Lorenz Meier
parent
52542f9802
commit
3d668d871b
@@ -94,6 +94,12 @@ int Tunes::set_control(const tune_control_s &tune_control)
|
|||||||
tune_control.tune_override || // Override interrupts everything
|
tune_control.tune_override || // Override interrupts everything
|
||||||
_default_tunes_interruptable[_current_tune_id]) {
|
_default_tunes_interruptable[_current_tune_id]) {
|
||||||
|
|
||||||
|
// Check if this exact tune is already being played back
|
||||||
|
if (tune_control.tune_id != static_cast<int>(TuneID::CUSTOM) &&
|
||||||
|
_tune == _default_tunes[tune_control.tune_id]) {
|
||||||
|
return OK; // Nothing to do
|
||||||
|
}
|
||||||
|
|
||||||
// Reset repeat flag. Can jump to true again while tune is being parsed later
|
// Reset repeat flag. Can jump to true again while tune is being parsed later
|
||||||
_repeat = false;
|
_repeat = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user