tunes: don't let tune interrupt itself

This commit is contained in:
Alessandro Simovic 2019-03-29 14:27:22 +01:00 committed by Lorenz Meier
parent 52542f9802
commit 3d668d871b

View File

@ -94,6 +94,12 @@ int Tunes::set_control(const tune_control_s &tune_control)
tune_control.tune_override || // Override interrupts everything
_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
_repeat = false;