Some logic fixes

This commit is contained in:
klaute 2019-02-02 13:31:21 +01:00
parent ef2a6c15de
commit 2bdc615ddb
2 changed files with 6 additions and 6 deletions

View file

@ -15,8 +15,8 @@
#define BAT_CHARGE_STATE_CHARGING 1.0
#define BAT_CHARGE_STATE_NOTCHARGING 0.0
#define WIFI_AUTOCONNECT_TIMEOUT_S 60
#define WIFI_CONFIG_PORTAL_TIMEOUT_S 60
#define WIFI_AUTOCONNECT_TIMEOUT_S 120
#define WIFI_CONFIG_PORTAL_TIMEOUT_S 120
#define UPDATE_SENSOR_INTERVAL_S 10
#define UPDATE_WEBSERVER_INTVERVAL_S 1
#define DELAY_LOOP_MS 50

View file

@ -57,8 +57,8 @@ void setup() {
#endif
// Pin settings
pinMode(BAT_CHARGED_PIN, INPUT);
pinMode(BAT_CHARGING_PIN, INPUT);
pinMode(BAT_CHARGED_PIN, INPUT_PULLUP);
pinMode(BAT_CHARGING_PIN, INPUT_PULLUP);
pinMode(STATUS_LED_PIN, OUTPUT);
pinMode(ANEMOMETER_PIN, INPUT_PULLUP);
pinMode(A0, INPUT);
@ -214,10 +214,10 @@ void _loop() {
// Disable expensive tasks
if (energySavingMode() == 0) {
currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed();
currentSensorData[SENSOR_ESAVEMODE] = 1.0;
currentSensorData[SENSOR_ESAVEMODE] = 0.0;
} else {
currentSensorData[SENSOR_WINDSPEED] = 0xFFFFFFFF;
currentSensorData[SENSOR_ESAVEMODE] = 0.0;
currentSensorData[SENSOR_ESAVEMODE] = 1.0;
}
#ifdef DEBUG