Removed sensor_ids array, increased logger list length.

This commit is contained in:
Kai Lauterbach 2022-09-13 13:17:38 +02:00
parent ed3a956dc6
commit 7770f83ef7
2 changed files with 4 additions and 13 deletions

View file

@ -32,15 +32,6 @@ float currentSensorData[VALUES] = { nanf("no value"), nanf("no value"), nanf("no
nanf("no value"), nanf("no value") }; nanf("no value"), nanf("no value") };
float (*sensors[VALUES])() = {}; float (*sensors[VALUES])() = {};
uint8_t sensor_ids[] = { SENSOR_TEMPERATURE,
SENSOR_HUMIDITY,
SENSOR_LIGHT,
SENSOR_WINDSPEED,
SENSOR_PRESSURE,
SENSOR_BAT_VOLTAGE,
SENSOR_ESAVEMODE,
SENSOR_BATCHARGESTATE };
uint32_t update_sensor_cnt = 0; uint32_t update_sensor_cnt = 0;
uint32_t update_webserver_cnt = 0; uint32_t update_webserver_cnt = 0;
uint32_t update_windspeed_exceed_cnt = 0; uint32_t update_windspeed_exceed_cnt = 0;
@ -351,13 +342,13 @@ void _loop()
debug("read sensor data " + String(sensor_cnt)); debug("read sensor data " + String(sensor_cnt));
if (sensors[sensor_cnt]) if (sensors[sensor_cnt])
{ {
debug("sensors[sensor_ids[" + String(sensor_cnt) + " ]]=" + String((int)sensors[sensor_cnt]) + ":" + String((int)sensors[sensor_ids[sensor_cnt]]) + ":" + String(sensor_ids[sensor_cnt])); debug("sensors[sensor_ids[" + String(sensor_cnt) + "]]=" + String((int)sensors[sensor_cnt]));
//currentSensorData[sensor_cnt] = sensors[sensor_ids[sensor_cnt]](); //currentSensorData[sensor_cnt] = sensors[sensor_cnt]();
currentSensorData[sensor_cnt] = sensor_cnt; currentSensorData[sensor_cnt] = sensor_cnt;
} else { } else {
debug("sensors[sensor_ids[" + String(sensor_cnt) + "]]=nan"); debug("sensors[" + String(sensor_cnt) + "]=nan");
currentSensorData[sensor_cnt] = nan("no value"); currentSensorData[sensor_cnt] = nan("no value");
} }

View file

@ -210,7 +210,7 @@ void measureWindspeed()
#ifdef USE_LOGGER #ifdef USE_LOGGER
#define LOGFILE_SIZE 20 #define LOGFILE_SIZE 25
String logfile[LOGFILE_SIZE]; String logfile[LOGFILE_SIZE];