mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 17:53:33 +08:00
libtunes: fixed some type conversions and other minor changes
This commit is contained in:
committed by
Beat Küng
parent
92b89368f1
commit
80d80835a0
@@ -115,7 +115,6 @@ int Tunes::set_control(const tune_control_s &tune_control)
|
||||
// Special treatment for custom tunes
|
||||
if (tune_control.tune_id == static_cast<int>(TuneID::CUSTOM)) {
|
||||
_using_custom_msg = true;
|
||||
_tune = nullptr; // remove tune in case of override
|
||||
_frequency = (unsigned)tune_control.frequency;
|
||||
_duration = (unsigned)tune_control.duration;
|
||||
_silence = (unsigned)tune_control.silence;
|
||||
@@ -144,7 +143,7 @@ void Tunes::set_string(const char *const string, uint8_t strength)
|
||||
}
|
||||
|
||||
int Tunes::get_next_tune(unsigned &frequency, unsigned &duration,
|
||||
unsigned &silence, unsigned &strength)
|
||||
unsigned &silence, uint8_t &strength)
|
||||
{
|
||||
int ret = get_next_tune(frequency, duration, silence);
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
*
|
||||
* @param string tune input string
|
||||
*/
|
||||
void set_string(const char *const string);
|
||||
void set_string(const char *const string, uint8_t strength);
|
||||
|
||||
/**
|
||||
* Get next note in the current tune, which has been provided by either
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
* @return -1 for error, 0 for play one tone and 1 for continue a sequence
|
||||
*/
|
||||
int get_next_tune(unsigned &frequency, unsigned &duration, unsigned &silence,
|
||||
unsigned &strength);
|
||||
uint8_t &strength);
|
||||
|
||||
/**
|
||||
* Get the number of default tunes. This is useful for when a tune is
|
||||
@@ -148,7 +148,7 @@ private:
|
||||
unsigned _frequency;
|
||||
unsigned _duration;
|
||||
unsigned _silence;
|
||||
unsigned _strength;
|
||||
uint8_t _strength;
|
||||
bool _using_custom_msg = false;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user