Skip to content
Snippets Groups Projects
Commit 2ec5ea48 authored by Martina's avatar Martina Committed by Daniel Agar
Browse files

tunes: for custom tunes set silence from tune control message and set

silence to 0 when the end of the string is reached
parent 9611641b
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,7 @@ int Tunes::set_control(const tune_control_s &tune_control)
case tune_control_s::TUNE_ID_CUSTOM:
_frequency = (unsigned)tune_control.frequency;
_duration = (unsigned)tune_control.duration;
_silence = (unsigned)tune_control.silence;
_using_custom_msg = true;
break;
......@@ -151,7 +152,7 @@ int Tunes::get_next_tune(unsigned &frequency, unsigned &duration, unsigned &sile
_using_custom_msg = false;
frequency = _frequency;
duration = _duration;
silence = 0;
silence = _silence;
return TUNE_STOP;
}
......@@ -169,6 +170,7 @@ int Tunes::get_next_tune(unsigned &frequency, unsigned &duration, unsigned &sile
int c = next_char();
if (c == 0) {
silence = 0;
goto tune_end;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment