Browse Source

AP_Notify: Add missing const in member functions

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
zr-v5.1
Patrick José Pereira 4 years ago committed by Andrew Tridgell
parent
commit
3df3d002ff
  1. 2
      libraries/AP_Notify/MMLPlayer.cpp
  2. 2
      libraries/AP_Notify/MMLPlayer.h
  3. 2
      libraries/AP_Notify/OreoLED_I2C.cpp
  4. 2
      libraries/AP_Notify/OreoLED_I2C.h

2
libraries/AP_Notify/MMLPlayer.cpp

@ -106,7 +106,7 @@ size_t MMLPlayer::next_dots()
return ret; return ret;
} }
float MMLPlayer::rest_duration(uint32_t rest_length, uint8_t dots) float MMLPlayer::rest_duration(uint32_t rest_length, uint8_t dots) const
{ {
float whole_note_period = 240.0f / _tempo; float whole_note_period = 240.0f / _tempo;
if (rest_length == 0) { if (rest_length == 0) {

2
libraries/AP_Notify/MMLPlayer.h

@ -37,7 +37,7 @@ private:
char next_char(); char next_char();
uint8_t next_number(); uint8_t next_number();
size_t next_dots(); size_t next_dots();
float rest_duration(uint32_t rest_length, uint8_t dots); float rest_duration(uint32_t rest_length, uint8_t dots) const;
// Called when the MML player should start the next action // Called when the MML player should start the next action
void next_action(); void next_action();

2
libraries/AP_Notify/OreoLED_I2C.cpp

@ -701,7 +701,7 @@ void OreoLED_I2C::oreo_state::set_rgb(enum oreoled_pattern new_pattern, uint8_t
phase_offset = new_phase_offset; phase_offset = new_phase_offset;
} }
bool OreoLED_I2C::oreo_state::operator==(const OreoLED_I2C::oreo_state &os) bool OreoLED_I2C::oreo_state::operator==(const OreoLED_I2C::oreo_state &os) const
{ {
return ((os.mode==mode) && (os.pattern==pattern) && (os.macro==macro) && (os.red==red) && (os.green==green) && (os.blue==blue) return ((os.mode==mode) && (os.pattern==pattern) && (os.macro==macro) && (os.red==red) && (os.green==green) && (os.blue==blue)
&& (os.amplitude_red==amplitude_red) && (os.amplitude_green==amplitude_green) && (os.amplitude_blue==amplitude_blue) && (os.amplitude_red==amplitude_red) && (os.amplitude_green==amplitude_green) && (os.amplitude_blue==amplitude_blue)

2
libraries/AP_Notify/OreoLED_I2C.h

@ -164,7 +164,7 @@ private:
uint8_t new_blue, uint8_t new_amplitude_red, uint8_t new_amplitude_green, uint8_t new_amplitude_blue, uint8_t new_blue, uint8_t new_amplitude_red, uint8_t new_amplitude_green, uint8_t new_amplitude_blue,
uint16_t new_period, uint16_t new_phase_offset); uint16_t new_period, uint16_t new_phase_offset);
bool operator==(const oreo_state &os); bool operator==(const oreo_state &os) const;
}; };
typedef struct { typedef struct {

Loading…
Cancel
Save