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
+3 -11
View File
@@ -114,27 +114,19 @@ void MotorControl::emergencyStop() {
setRealPower(0);
}
int8_t MotorControl::getPower() {
return this->power;
}
int8_t MotorControl::getTargetPower() {
return this->targetPower;
}
bool MotorControl::isTargetPowerReached() {
bool MotorControl::isTargetPowerReached() const {
if (this->targetPower == this->power)
return true;
return false;
}
bool MotorControl::isAccelerationPositive() {
bool MotorControl::isAccelerationPositive() const {
if (power < targetPower)
return true;
return false;
}
bool MotorControl::isAccelerationNegative() {
bool MotorControl::isAccelerationNegative() const {
if (power > targetPower)
return true;
return false;