mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 16:48:52 +08:00
libtunes: If default tune does not exist
return -EINVAL
This commit is contained in:
committed by
Daniel Agar
parent
915f728145
commit
f63be6b055
@@ -78,7 +78,7 @@ void Tunes::config_tone()
|
||||
_octave = _default_octave;
|
||||
}
|
||||
|
||||
void Tunes::set_control(const tune_control_s &tune_control)
|
||||
int Tunes::set_control(const tune_control_s &tune_control)
|
||||
{
|
||||
bool reset_playing_tune = false;
|
||||
|
||||
@@ -120,8 +120,10 @@ void Tunes::set_control(const tune_control_s &tune_control)
|
||||
|
||||
} else {
|
||||
PX4_WARN("Tune ID not recognized.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
void Tunes::set_string(const char *string)
|
||||
|
||||
@@ -65,10 +65,10 @@ public:
|
||||
|
||||
/**
|
||||
* Set tune to be played.
|
||||
*
|
||||
* @param tune_control struct containig the uORB message
|
||||
* @return return -EINVAL if the default tune does not exist.
|
||||
*/
|
||||
void set_control(const tune_control_s &tune_control);
|
||||
int set_control(const tune_control_s &tune_control);
|
||||
|
||||
/**
|
||||
* Parse a tune string, formatted with the syntax of the Microsoft GWBasic/QBasic.
|
||||
|
||||
Reference in New Issue
Block a user