formating only

This commit is contained in:
Empire 2022-04-29 10:47:54 +02:00
parent 15e96a4990
commit 5dedc76727

View File

@ -40,7 +40,6 @@
#include "ulp-pwm.h"
#endif
/******************************************************************************
* DEFINES
******************************************************************************/
@ -316,16 +315,18 @@ void readPowerSwitchedSensors()
Plant plant = mPlants[i];
switch (plant.getSensorMode())
{
case CAPACITIVE_FREQUENCY: {
case CAPACITIVE_FREQUENCY:
{
Serial << "Plant " << i << " measurement: " << mPlants[i].getCurrentMoistureRaw() << " hz " << mPlants[i].getCurrentMoisturePCT() << "%" << endl;
break;
}
case ANALOG_RESISTANCE_PROBE : {
case ANALOG_RESISTANCE_PROBE:
{
Serial << "Plant " << i << " measurement: " << mPlants[i].getCurrentMoistureRaw() << " mV " << mPlants[i].getCurrentMoisturePCT() << "%" << endl;
break;
}
case NONE : {
case NONE:
{
}
}
}
@ -486,12 +487,14 @@ int determineNextPump(bool isLowLight)
}
else
{
if(mDownloadMode){
if (mDownloadMode)
{
plant.publishState("active+supressed");
}else {
}
else
{
plant.publishState("active");
}
}
if (!plant.isHydroponic())
@ -636,7 +639,6 @@ void initPumpLogic()
log(LOG_LEVEL_INFO, "Starting pump " + String(pumpToRun) + " for " + String(mPlants[pumpToRun].getPumpDuration()) + "s", LOG_PUMP_STARTED_CODE);
#endif
// enable power
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);
digitalWrite(OUTPUT_ENABLE_PUMP, HIGH);
@ -674,7 +676,6 @@ long duration = millis() - pumpStartTime;
log(LOG_LEVEL_ERROR, LOG_HARDWARECOUNTER_ERROR_MESSAGE, LOG_HARDWARECOUNTER_ERROR_CODE);
targetReached = true;
log(LOG_LEVEL_INFO, "Reached pump target ml " + String(pumpToRun), LOG_PUMP_STARTED_CODE);
}
else
{
@ -695,7 +696,6 @@ long duration = millis() - pumpStartTime;
}
#endif
if (millis() > pumpTarget)
{
mPlants[pumpToRun].setProperty("watertime").send(String(duration));
@ -809,14 +809,12 @@ void safeSetup()
}
readPowerSwitchedSensors();
Homie.setup();
Wire = TwoWire(0);
Wire.setPins(SENSOR_TANK_SDA, SENSOR_TANK_SCL);
Wire.begin();
/************************* Start One-Wire bus ***************/
int tempInitStartTime = millis();
uint8_t sensorCount = 0U;
@ -1077,9 +1075,12 @@ void plantcontrol()
#if defined(TIMED_LIGHT_PIN)
bool isLowLight = mSolarVoltage <= 9;
bool shouldLight = determineTimedLightState(isLowLight);
if(shouldLight){
if (shouldLight)
{
ulp_pwm_set_level(timedLightPowerLevel.get());
}else {
}
else
{
ulp_pwm_set_level(0);
}