Fixing ifdef logic
This commit is contained in:
parent
dfc2d277d1
commit
b0ec86890d
1 changed files with 7 additions and 4 deletions
11
firmware/firmware.ino
Executable file → Normal file
11
firmware/firmware.ino
Executable file → Normal file
|
@ -238,15 +238,18 @@ void _loop() {
|
||||||
currentSensorData[SENSOR_BAT_VOLTAGE] = 0xFFFFFFFF;
|
currentSensorData[SENSOR_BAT_VOLTAGE] = 0xFFFFFFFF;
|
||||||
currentSensorData[SENSOR_BATCHARGESTATE] = 0xFFFFFFFF;
|
currentSensorData[SENSOR_BATCHARGESTATE] = 0xFFFFFFFF;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef BATTERY_POWERED
|
||||||
// Disable expensive tasks
|
// Disable expensive tasks
|
||||||
if (energySavingMode() == 0) {
|
if (energySavingMode() == 0) {
|
||||||
|
#endif
|
||||||
currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed();
|
currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed();
|
||||||
currentSensorData[SENSOR_ESAVEMODE] = ENERGY_SAVE_MODE_DISABLED;
|
currentSensorData[SENSOR_ESAVEMODE] = ENERGY_SAVE_MODE_DISABLED;
|
||||||
|
#ifdef BATTERY_POWERED
|
||||||
} else {
|
} else {
|
||||||
currentSensorData[SENSOR_WINDSPEED] = 0xFFFFFFFF;
|
currentSensorData[SENSOR_WINDSPEED] = 0xFFFFFFFF;
|
||||||
currentSensorData[SENSOR_ESAVEMODE] = ENERGY_SAVE_MODE_ENABLED;
|
currentSensorData[SENSOR_ESAVEMODE] = ENERGY_SAVE_MODE_ENABLED;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Serial.println("");
|
Serial.println("");
|
||||||
//Serial.println("Current readings:");
|
//Serial.println("Current readings:");
|
||||||
|
@ -265,12 +268,12 @@ void _loop() {
|
||||||
pushToInfluxDB(DEVICE_NAME, currentSensorData);
|
pushToInfluxDB(DEVICE_NAME, currentSensorData);
|
||||||
|
|
||||||
#ifdef WEBUPDATER_FEATURE
|
#ifdef WEBUPDATER_FEATURE
|
||||||
#ifndef BATTERY_POWERED
|
|
||||||
setSensorData(DEVICE_NAME, localIP, currentSensorData);
|
setSensorData(DEVICE_NAME, localIP, currentSensorData);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef BATTERY_POWERED
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//*************************************************************************//
|
//*************************************************************************//
|
||||||
|
|
Loading…
Reference in a new issue