runningTime is now the time for every state
This commit is contained in:
+1
-4
@@ -80,9 +80,6 @@ void Pump::clearError() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Pump::getRunningTime() const {
|
uint32_t Pump::getRunningTime() const {
|
||||||
if (this->state == State::Off)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return (millis() - this->startTime) / 1000;
|
return (millis() - this->startTime) / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,9 +135,9 @@ bool Pump::checkSensorsValues() {
|
|||||||
void Pump::handlePins(bool state) {
|
void Pump::handlePins(bool state) {
|
||||||
digitalWrite(this->pumpPin, state);
|
digitalWrite(this->pumpPin, state);
|
||||||
digitalWrite(this->ledPin, state);
|
digitalWrite(this->ledPin, state);
|
||||||
|
this->startTime = millis();
|
||||||
if (state) {
|
if (state) {
|
||||||
this->timerStandby = false;
|
this->timerStandby = false;
|
||||||
this->startTime = millis();
|
|
||||||
this->maxPressureStart = 0;
|
this->maxPressureStart = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user