Browse Source

libtunes: addressing comments of #9117

sbg
Alessandro Simovic 7 years ago committed by Beat Küng
parent
commit
9d3dfb7864
  1. 1
      src/lib/tunes/tunes.cpp
  2. 3
      src/lib/tunes/tunes.h
  3. 6
      src/systemcmds/tune_control/tune_control.cpp

1
src/lib/tunes/tunes.cpp

@ -89,7 +89,6 @@ int Tunes::set_control(const tune_control_s &tune_control)
{ {
// Sanity check // Sanity check
if (tune_control.tune_id >= _default_tunes_size) { if (tune_control.tune_id >= _default_tunes_size) {
PX4_WARN("Tune ID not recognized.");
return -EINVAL; return -EINVAL;
} }

3
src/lib/tunes/tunes.h

@ -73,9 +73,6 @@ public:
*/ */
Tunes(unsigned default_tempo, unsigned default_octave, unsigned default_note_length, NoteMode default_mode); Tunes(unsigned default_tempo, unsigned default_octave, unsigned default_note_length, NoteMode default_mode);
/**
* Default destructor
*/
~Tunes() = default; ~Tunes() = default;
/** /**

6
src/systemcmds/tune_control/tune_control.cpp

@ -207,7 +207,11 @@ tune_control_main(int argc, char *argv[])
} }
} else if (!strcmp(argv[myoptind], "libtest")) { } else if (!strcmp(argv[myoptind], "libtest")) {
tunes.set_control(tune_control); int ret = tunes.set_control(tune_control);
if (ret == -EINVAL) {
PX4_WARN("Tune ID not recognized.");
}
while (tunes.get_next_tune(frequency, duration, silence, strength) > 0) { while (tunes.get_next_tune(frequency, duration, silence, strength) > 0) {
PX4_INFO("frequency: %d, duration %d, silence %d, strength%d", PX4_INFO("frequency: %d, duration %d, silence %d, strength%d",

Loading…
Cancel
Save