Browse Source

Fixing ifdef logic

Thomas Kopp 1 year ago
parent
commit
b0ec86890d
1 changed files with 7 additions and 4 deletions
  1. 7
    4
      firmware/firmware.ino

+ 7
- 4
firmware/firmware.ino View File

@@ -238,15 +238,18 @@ void _loop() {
238 238
     currentSensorData[SENSOR_BAT_VOLTAGE]    = 0xFFFFFFFF;
239 239
     currentSensorData[SENSOR_BATCHARGESTATE] = 0xFFFFFFFF;
240 240
 #endif
241
+#ifdef BATTERY_POWERED
241 242
     // Disable expensive tasks
242 243
     if (energySavingMode() == 0) {
244
+#endif
243 245
       currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed();
244 246
       currentSensorData[SENSOR_ESAVEMODE] = ENERGY_SAVE_MODE_DISABLED;
247
+#ifdef BATTERY_POWERED
245 248
     } else {
246 249
       currentSensorData[SENSOR_WINDSPEED] = 0xFFFFFFFF;
247 250
       currentSensorData[SENSOR_ESAVEMODE] = ENERGY_SAVE_MODE_ENABLED;
248 251
     }
249
-
252
+#endif
250 253
 #ifdef DEBUG
251 254
     Serial.println("");
252 255
     //Serial.println("Current readings:");
@@ -265,12 +268,12 @@ void _loop() {
265 268
     pushToInfluxDB(DEVICE_NAME, currentSensorData);
266 269
 
267 270
 #ifdef WEBUPDATER_FEATURE
268
-#ifndef BATTERY_POWERED
269 271
     setSensorData(DEVICE_NAME, localIP, currentSensorData);
270
-  }
271 272
 #endif
273
+#ifndef BATTERY_POWERED
274
+  }
272 275
 #endif
273 276
 
274 277
 }
275 278
 
276
-//*************************************************************************//
279
+//*************************************************************************//

Loading…
Cancel
Save