runningTime is now the time for every state

This commit is contained in:
2023-10-10 09:57:46 +02:00
parent f79c42dd28
commit bef0bb816c
+1 -4
View File
@@ -80,9 +80,6 @@ void Pump::clearError() {
}
uint32_t Pump::getRunningTime() const {
if (this->state == State::Off)
return 0;
return (millis() - this->startTime) / 1000;
}
@@ -138,9 +135,9 @@ bool Pump::checkSensorsValues() {
void Pump::handlePins(bool state) {
digitalWrite(this->pumpPin, state);
digitalWrite(this->ledPin, state);
this->startTime = millis();
if (state) {
this->timerStandby = false;
this->startTime = millis();
this->maxPressureStart = 0;
}
}