make all possible functions const
This commit is contained in:
@@ -48,14 +48,14 @@ class Battery : public Component {
|
||||
*
|
||||
* @return double in Volt
|
||||
*/
|
||||
double getBatteryVoltage();
|
||||
double getBatteryVoltage() const;
|
||||
|
||||
/**
|
||||
* @brief Get the charge level of the battery
|
||||
*
|
||||
* @return uint8_t charge level in percent
|
||||
*/
|
||||
uint8_t getBatteryPercent() { return this->batteryPercent; }
|
||||
uint8_t getBatteryPercent() const { return this->batteryPercent; }
|
||||
|
||||
/**
|
||||
* @brief Checks if the battery is low.
|
||||
@@ -68,7 +68,7 @@ class Battery : public Component {
|
||||
* @return true if the battery is low
|
||||
* @return false if the battery is high
|
||||
*/
|
||||
bool isBatteryLow(double voltage);
|
||||
bool isBatteryLow(double voltage) const;
|
||||
|
||||
bool isNewValue();
|
||||
|
||||
@@ -79,7 +79,7 @@ class Battery : public Component {
|
||||
void calculateBatteryPercent();
|
||||
void readAdcToBuf();
|
||||
void initBuffer();
|
||||
uint16_t getBufAvg();
|
||||
uint16_t getBufAvg() const;
|
||||
|
||||
static const uint8_t bufferSize = 30;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user