Skip to content
Snippets Groups Projects
Commit 61b38279 authored by Simone Guscetti's avatar Simone Guscetti Committed by Daniel Agar
Browse files

tune_control: Modify tune_control to use new lib functions

parent b84a97c6
No related branches found
No related tags found
No related merge requests found
......@@ -163,8 +163,9 @@ tune_control_main(int argc, char *argv[])
if (!strcmp(argv[myoptind], "play")) {
if (string_input) {
PX4_INFO("Start playback...");
tunes.set_string(tune_string);
while (tunes.parse_string(tune_string, frequency, duration, silence) > 0) {
while (tunes.get_next_tune(frequency, duration, silence) > 0) {
tune_control.tune_id = 0;
tune_control.frequency = (uint16_t)frequency;
tune_control.duration = (uint32_t)duration;
......@@ -190,7 +191,9 @@ tune_control_main(int argc, char *argv[])
}
} else if (!strcmp(argv[myoptind], "libtest")) {
while (tunes.parse_cmd(tune_control, frequency, duration, silence) > 0) {
tunes.set_control(tune_control);
while (tunes.get_next_tune(frequency, duration, silence) > 0) {
PX4_INFO("frequency: %d, duration %d, silence %d", frequency, duration, silence);
usleep(500000);
exit_counter++;
......
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