lib tunes: Add string input method

This commit is contained in:
Simone Guscetti
2018-01-29 09:45:59 -05:00
committed by Daniel Agar
parent 8ce57bedb7
commit 79ae413982
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -140,6 +140,17 @@ int Tunes::parse_cmd(struct tune_control_s &tune_control, unsigned &frequency, u
return continue_sequnece;
}
int Tunes::parse_string(const char *string, unsigned &frequency, unsigned &duration, unsigned &silence)
{
// set tune string the first time
if (_tune == nullptr) {
_tune = string;
_next = _tune;
}
return next_note(frequency, duration, silence);
}
unsigned Tunes::note_to_frequency(unsigned note)
{
// compute the frequency (Hz)