make all possible functions const

This commit is contained in:
2023-08-18 11:44:10 +02:00
parent 11d21e2e89
commit 4cd2b9368d
18 changed files with 33 additions and 52 deletions
+4 -4
View File
@@ -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;