Browse Source

Some logic fixes

klaute 1 year ago
parent
commit
2bdc615ddb
2 changed files with 6 additions and 6 deletions
  1. 2
    2
      firmware/config.h
  2. 4
    4
      firmware/firmware.ino

+ 2
- 2
firmware/config.h View File

@@ -15,8 +15,8 @@
15 15
 #define BAT_CHARGE_STATE_CHARGING    1.0
16 16
 #define BAT_CHARGE_STATE_NOTCHARGING 0.0
17 17
 
18
-#define WIFI_AUTOCONNECT_TIMEOUT_S       60
19
-#define WIFI_CONFIG_PORTAL_TIMEOUT_S     60
18
+#define WIFI_AUTOCONNECT_TIMEOUT_S       120
19
+#define WIFI_CONFIG_PORTAL_TIMEOUT_S     120
20 20
 #define UPDATE_SENSOR_INTERVAL_S         10
21 21
 #define UPDATE_WEBSERVER_INTVERVAL_S      1
22 22
 #define DELAY_LOOP_MS                    50

+ 4
- 4
firmware/firmware.ino View File

@@ -57,8 +57,8 @@ void setup() {
57 57
 #endif
58 58
 
59 59
   // Pin settings
60
-  pinMode(BAT_CHARGED_PIN, INPUT);
61
-  pinMode(BAT_CHARGING_PIN, INPUT);
60
+  pinMode(BAT_CHARGED_PIN, INPUT_PULLUP);
61
+  pinMode(BAT_CHARGING_PIN, INPUT_PULLUP);
62 62
   pinMode(STATUS_LED_PIN, OUTPUT);
63 63
   pinMode(ANEMOMETER_PIN, INPUT_PULLUP);
64 64
   pinMode(A0, INPUT);
@@ -214,10 +214,10 @@ void _loop() {
214 214
     // Disable expensive tasks
215 215
     if (energySavingMode() == 0) {
216 216
       currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed();
217
-      currentSensorData[SENSOR_ESAVEMODE] = 1.0;
217
+      currentSensorData[SENSOR_ESAVEMODE] = 0.0;
218 218
     } else {
219 219
       currentSensorData[SENSOR_WINDSPEED] = 0xFFFFFFFF;
220
-      currentSensorData[SENSOR_ESAVEMODE] = 0.0;
220
+      currentSensorData[SENSOR_ESAVEMODE] = 1.0;
221 221
     }
222 222
 
223 223
 #ifdef DEBUG

Loading…
Cancel
Save