do not use pump for download indication anymore

This commit is contained in:
Empire 2022-04-29 10:47:16 +02:00
parent 7a841d423b
commit 0dd4553999

View File

@ -56,6 +56,7 @@ int determineNextPump(bool lowLight);
void plantcontrol(); void plantcontrol();
void readPowerSwitchedSensors(); void readPowerSwitchedSensors();
bool determineTimedLightState(bool lowLight); bool determineTimedLightState(bool lowLight);
bool otaRunning = false;
/****************************************************************************** /******************************************************************************
* NON VOLATILE VARIABLES in DEEP SLEEP * NON VOLATILE VARIABLES in DEEP SLEEP
@ -401,10 +402,7 @@ void onHomieEvent(const HomieEvent &event)
{ {
mPlants[i].deactivatePump(); mPlants[i].deactivatePump();
} }
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); otaRunning = true;
digitalWrite(OUTPUT_ENABLE_PUMP, HIGH);
delay(100);
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 1);
mDownloadMode = true; mDownloadMode = true;
break; break;
case HomieEventType::OTA_SUCCESSFUL: case HomieEventType::OTA_SUCCESSFUL:
@ -981,7 +979,14 @@ void loop()
digitalWrite(OUTPUT_ENABLE_SENSOR, !digitalRead(OUTPUT_ENABLE_SENSOR)); digitalWrite(OUTPUT_ENABLE_SENSOR, !digitalRead(OUTPUT_ENABLE_SENSOR));
if (mConfigured) if (mConfigured)
{ {
nextBlink = millis() + 500; if (otaRunning)
{
nextBlink = millis() + 100;
}
else
{
nextBlink = millis() + 501;
}
} }
else else
{ {