Fixing ifdef logic

This commit is contained in:
Thomas Kopp 2019-03-31 16:17:57 +02:00
parent dfc2d277d1
commit b0ec86890d

9
firmware/firmware.ino Executable file → Normal file
View 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,10 +268,10 @@ 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
} }