libtunes: fixed some type conversions and other minor changes

This commit is contained in:
Alessandro Simovic
2018-03-26 14:54:23 +02:00
committed by Beat Küng
parent 92b89368f1
commit 80d80835a0
3 changed files with 10 additions and 10 deletions
+1 -2
View File
@@ -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);
+3 -3
View File
@@ -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;
/**