diff --git a/code/espurna/config/dependencies.h b/code/espurna/config/dependencies.h index b9da6342..e0abceb8 100644 --- a/code/espurna/config/dependencies.h +++ b/code/espurna/config/dependencies.h @@ -1,11 +1,12 @@ -#pragma once - //------------------------------------------------------------------------------ // Do not change this file unless you know what you are doing // Configuration settings are in the general.h file //------------------------------------------------------------------------------ -#define DEBUG_SUPPORT (DEBUG_SERIAL_SUPPORT || DEBUG_UDP_SUPPORT || DEBUG_TELNET_SUPPORT || DEBUG_WEB_SUPPORT) +#pragma once + +//------------------------------------------------------------------------------ +// Various modules configuration #if DEBUG_TELNET_SUPPORT #undef TELNET_SUPPORT @@ -28,11 +29,10 @@ #endif #if UART_MQTT_SUPPORT -#define MQTT_SUPPORT 1 -#undef TERMINAL_SUPPORT -#define TERMINAL_SUPPORT 0 +#undef MQTT_SUPPORT +#define MQTT_SUPPORT 1 // UART<->MQTT requires MQTT and no serial debug #undef DEBUG_SERIAL_SUPPORT -#define DEBUG_SERIAL_SUPPORT 0 +#define DEBUG_SERIAL_SUPPORT 0 // TODO: compare UART_MQTT_PORT with DEBUG_PORT? (as strings) #endif #if ALEXA_SUPPORT @@ -43,8 +43,6 @@ #if RPN_RULES_SUPPORT #undef BROKER_SUPPORT #define BROKER_SUPPORT 1 // If RPN Rules enabled enable BROKER -#undef WEB_SUPPORT -#define WEB_SUPPORT 1 #undef MQTT_SUPPORT #define MQTT_SUPPORT 1 #endif @@ -60,10 +58,10 @@ #endif #if DOMOTICZ_SUPPORT -#undef MQTT_SUPPORT -#define MQTT_SUPPORT 1 // If Domoticz enabled enable MQTT #undef BROKER_SUPPORT #define BROKER_SUPPORT 1 // If Domoticz enabled enable BROKER +#undef MQTT_SUPPORT +#define MQTT_SUPPORT 1 // If Domoticz enabled enable MQTT #endif #if HOMEASSISTANT_SUPPORT @@ -91,21 +89,6 @@ #define TELNET_SERVER_ASYNC_BUFFERED 1 // enable buffered telnet by default on latest Cores #endif -#if LLMNR_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0) -#undef LLMNR_SUPPORT -#define LLMNR_SUPPORT 0 -#endif - -#if NETBIOS_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0) -#undef NETBIOS_SUPPORT -#define NETBIOS_SUPPORT 0 -#endif - -#if SSDP_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0) -#undef SSDP_SUPPORT -#define SSDP_SUPPORT 0 -#endif - #if LIGHT_PROVIDER == LIGHT_PROVIDER_TUYA #undef TUYA_SUPPORT #define TUYA_SUPPORT 1 // Need base Tuya module for this to work @@ -118,7 +101,10 @@ #define BROKER_SUPPORT 1 // Broker is required to process relay & lights events #endif +//------------------------------------------------------------------------------ +// Hint about ESPAsyncTCP options and our internal one // TODO: clean-up SSL_ENABLED and USE_SSL settings for 1.15.0 + #if ASYNC_TCP_SSL_ENABLED && SECURE_CLIENT == SECURE_CLIENT_NONE #undef SECURE_CLIENT #define SECURE_CLIENT SECURE_CLIENT_AXTLS @@ -141,3 +127,22 @@ #define DEBUG_LOG_BUFFER_SUPPORT 0 // Can't buffer if there is no debugging enabled. // Helps to avoid checking twice for both DEBUG_SUPPORT and BUFFER_LOG_SUPPORT #endif + +//------------------------------------------------------------------------------ +// These depend on newest Core libraries + +#if LLMNR_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0) +#undef LLMNR_SUPPORT +#define LLMNR_SUPPORT 0 +#endif + +#if NETBIOS_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0) +#undef NETBIOS_SUPPORT +#define NETBIOS_SUPPORT 0 +#endif + +#if SSDP_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0) +#undef SSDP_SUPPORT +#define SSDP_SUPPORT 0 +#endif + diff --git a/code/espurna/config/deprecated.h b/code/espurna/config/deprecated.h index 05b1f770..c2892a7b 100644 --- a/code/espurna/config/deprecated.h +++ b/code/espurna/config/deprecated.h @@ -48,8 +48,3 @@ #warning "Current implementation of AsyncMqttClient with axTLS is no longer supported. Consider switching to the SECURE_CLIENT configuration with MQTT_LIBRARY_ARDUINOMQTT or MQTT_LIBRARY_PUBSUBCLIENT. See: https://github.com/xoseperez/espurna/issues/1465" #endif -// 1.14.2 renames MQTT to MANUAL -#undef LED_MODE_MQTT -#ifdef LED_MODE_MQTT -#warning LED_MODE_MQTT is deprecated! Please use LED_MODE_MANUAL instead -#endif diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index f6f76fcd..39615512 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -1926,3 +1926,20 @@ #ifndef TUYA_SERIAL #define TUYA_SERIAL Serial #endif + +// ============================================================================= +// Configuration helpers +// ============================================================================= + +//------------------------------------------------------------------------------ +// Provide generic way to detect debugging support +//------------------------------------------------------------------------------ +#ifndef DEBUG_SUPPORT +#define DEBUG_SUPPORT ( \ + DEBUG_SERIAL_SUPPORT || \ + DEBUG_UDP_SUPPORT || \ + DEBUG_TELNET_SUPPORT || \ + DEBUG_WEB_SUPPORT \ +) +#endif + diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index e3a77043..9d0ead61 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -1,19 +1,42 @@ // ============================================================================= -// SENSORS - General data +// SENSORS - General configuration // ============================================================================= +#ifndef SENSOR_DEBUG #define SENSOR_DEBUG 0 // Debug sensors +#endif +#ifndef SENSOR_READ_INTERVAL #define SENSOR_READ_INTERVAL 6 // Read data from sensors every 6 seconds +#endif + +#ifndef SENSOR_READ_MIN_INTERVAL #define SENSOR_READ_MIN_INTERVAL 1 // Minimum read interval +#endif + +#ifndef SENSOR_READ_MAX_INTERVAL #define SENSOR_READ_MAX_INTERVAL 3600 // Maximum read interval +#endif + +#ifndef SENSOR_INIT_INTERVAL #define SENSOR_INIT_INTERVAL 10000 // Try to re-init non-ready sensors every 10s +#endif +#ifndef SENSOR_REPORT_EVERY #define SENSOR_REPORT_EVERY 10 // Report every this many readings +#endif + +#ifndef SENSOR_REPORT_MIN_EVERY #define SENSOR_REPORT_MIN_EVERY 1 // Minimum every value +#endif + +#ifndef SENSOR_REPORT_MAX_EVERY #define SENSOR_REPORT_MAX_EVERY 60 // Maximum +#endif +#ifndef SENSOR_USE_INDEX #define SENSOR_USE_INDEX 0 // Use the index in topic (i.e. temperature/0) +#endif // even if just one sensor (0 for backwards compatibility) #ifndef SENSOR_POWER_CHECK_STATUS @@ -428,7 +451,9 @@ #define EMON_ADC121_SUPPORT 0 // Do not build support by default #endif +#ifndef EMON_ADC121_I2C_ADDRESS #define EMON_ADC121_I2C_ADDRESS 0x00 // 0x00 means auto +#endif //------------------------------------------------------------------------------ // Energy Monitor based on ADS1X15 @@ -439,7 +464,10 @@ #define EMON_ADS1X15_SUPPORT 0 // Do not build support by default #endif +#ifndef EMON_ADS1X15_I2C_ADDRESS #define EMON_ADS1X15_I2C_ADDRESS 0x00 // 0x00 means auto +#endif + #define EMON_ADS1X15_TYPE ADS1X15_CHIP_ADS1115 #define EMON_ADS1X15_GAIN ADS1X15_REG_CONFIG_PGA_4_096V #define EMON_ADS1X15_MASK 0x0F // A0=1 A1=2 A2=4 A3=8 @@ -1195,54 +1223,6 @@ #define EZOPH_SYNC_INTERVAL 1000 // Amount of time (in ms) sync new readings. #endif -// ============================================================================= -// Sensor helpers configuration - can't move to dependencies.h -// ============================================================================= - -#ifndef SENSOR_SUPPORT -#define SENSOR_SUPPORT ( \ - AM2320_SUPPORT || \ - ANALOG_SUPPORT || \ - BH1750_SUPPORT || \ - BMP180_SUPPORT || \ - BMX280_SUPPORT || \ - CSE7766_SUPPORT || \ - DALLAS_SUPPORT || \ - DHT_SUPPORT || \ - DIGITAL_SUPPORT || \ - ECH1560_SUPPORT || \ - EMON_ADC121_SUPPORT || \ - EMON_ADS1X15_SUPPORT || \ - EMON_ANALOG_SUPPORT || \ - EVENTS_SUPPORT || \ - EZOPH_SUPPORT || \ - GEIGER_SUPPORT || \ - GUVAS12SD_SUPPORT || \ - HLW8012_SUPPORT || \ - LDR_SUPPORT || \ - MAX6675_SUPPORT || \ - MICS2710_SUPPORT || \ - MICS5525_SUPPORT || \ - MHZ19_SUPPORT || \ - NTC_SUPPORT || \ - SDS011_SUPPORT || \ - SENSEAIR_SUPPORT || \ - PMSX003_SUPPORT || \ - PZEM004T_SUPPORT || \ - PULSEMETER_SUPPORT || \ - SHT3X_I2C_SUPPORT || \ - SI7021_SUPPORT || \ - SONAR_SUPPORT || \ - T6613_SUPPORT || \ - THERMOSTAT_SUPPORT || \ - TMP3X_SUPPORT || \ - V9261F_SUPPORT || \ - VEML6075_SUPPORT || \ - VL53L1X_SUPPORT || \ - ADE7953_SUPPORT \ -) -#endif - // ----------------------------------------------------------------------------- // ADC // ----------------------------------------------------------------------------- @@ -1299,162 +1279,83 @@ #define ADE7953_ADDRESS 0x38 #endif -//-------------------------------------------------------------------------------- -// Class loading -//-------------------------------------------------------------------------------- - -#if SENSOR_SUPPORT - -#if AM2320_SUPPORT - #include "../sensors/AM2320Sensor.h" -#endif - -#if ANALOG_SUPPORT - #include "../sensors/AnalogSensor.h" -#endif - -#if BH1750_SUPPORT - #include "../sensors/BH1750Sensor.h" -#endif - -#if BMP180_SUPPORT - #include "../sensors/BMP180Sensor.h" -#endif - -#if BMX280_SUPPORT - #include "../sensors/BMX280Sensor.h" -#endif - -#if CSE7766_SUPPORT - #include "../sensors/CSE7766Sensor.h" -#endif - -#if DALLAS_SUPPORT - #include "../sensors/DallasSensor.h" -#endif - -#if DHT_SUPPORT - #include "../sensors/DHTSensor.h" -#endif - -#if DIGITAL_SUPPORT - #include "../sensors/DigitalSensor.h" -#endif - -#if ECH1560_SUPPORT - #include "../sensors/ECH1560Sensor.h" -#endif - -#if EMON_ADC121_SUPPORT - #include "../sensors/EmonADC121Sensor.h" -#endif - -#if EMON_ADS1X15_SUPPORT - #include "../sensors/EmonADS1X15Sensor.h" -#endif - -#if EMON_ANALOG_SUPPORT - #include "../sensors/EmonAnalogSensor.h" -#endif - -#if EVENTS_SUPPORT - #include "../sensors/EventSensor.h" -#endif - -#if EZOPH_SUPPORT - #include "../sensors/EZOPHSensor.h" -#endif - -#if GEIGER_SUPPORT - #include "../sensors/GeigerSensor.h" -#endif - -#if GUVAS12SD_SUPPORT - #include "../sensors/GUVAS12SDSensor.h" -#endif - -#if HLW8012_SUPPORT - #include "../sensors/HLW8012Sensor.h" -#endif - -#if LDR_SUPPORT - #include "../sensors/LDRSensor.h" -#endif - -#if MAX6675_SUPPORT - #include "../sensors/MAX6675Sensor.h" -#endif - -#if MICS2710_SUPPORT - #include "../sensors/MICS2710Sensor.h" -#endif - -#if MICS5525_SUPPORT - #include "../sensors/MICS5525Sensor.h" -#endif - -#if MHZ19_SUPPORT - #include "../sensors/MHZ19Sensor.h" -#endif - -#if NTC_SUPPORT - #include "../sensors/NTCSensor.h" -#endif - -#if SDS011_SUPPORT - #include "../sensors/SDS011Sensor.h" -#endif - -#if SENSEAIR_SUPPORT - #include "../sensors/SenseAirSensor.h" -#endif - -#if PMSX003_SUPPORT - #include "../sensors/PMSX003Sensor.h" -#endif - -#if PULSEMETER_SUPPORT - #include "../sensors/PulseMeterSensor.h" -#endif - -#if PZEM004T_SUPPORT - #include "../sensors/PZEM004TSensor.h" -#endif - -#if SHT3X_I2C_SUPPORT - #include "../sensors/SHT3XI2CSensor.h" -#endif - -#if SI7021_SUPPORT - #include "../sensors/SI7021Sensor.h" -#endif - -#if SONAR_SUPPORT - #include "../sensors/SonarSensor.h" -#endif - -#if T6613_SUPPORT - #include "../sensors/T6613Sensor.h" -#endif - -#if TMP3X_SUPPORT - #include "../sensors/TMP3XSensor.h" -#endif - -#if V9261F_SUPPORT - #include "../sensors/V9261FSensor.h" -#endif +// ============================================================================= +// Configuration helpers +// ============================================================================= -#if VEML6075_SUPPORT - #include "../sensors/VEML6075Sensor.h" +// I2C support when sensor needs it +#if ( ADE7952_SUPPORT || \ + AM2320_SUPPORT || \ + BH1750_SUPPORT || \ + BMP180_SUPPORT || \ + BMX280_SUPPORT || \ + EMON_ADC121_SUPPORT || \ + EMON_ADS1X15_SUPPORT || \ + SHT3X_I2C_SUPPORT || \ + SI7021_SUPPORT || \ + VEML6075_SUPPORT || \ + VL53L1X_SUPPORT \ +) +#undef I2C_SUPPORT +#define I2C_SUPPORT 1 #endif -#if VL53L1X_SUPPORT - #include "../sensors/VL53L1XSensor.h" +// Can't have ADC reading something else +#if ( ANALOG_SUPPORT || \ + EMON_ANALOG_SUPPORT || \ + GUVAS12SD_SUPPORT || \ + LDR_SUPPORT || \ + MICS2710_SUPPORT || \ + MICS5525_SUPPORT || \ + NTC_SUPPORT || \ + TMP3X_SUPPORT \ +) +#undef ADC_MODE_VALUE +#define ADC_MODE_VALUE ADC_TOUT #endif -#if ADE7953_SUPPORT - #include "../sensors/ADE7953Sensor.h" +// Provide generic way to detect sensor presence +#ifndef SENSOR_SUPPORT +#define SENSOR_SUPPORT ( \ + ADE7953_SUPPORT || \ + AM2320_SUPPORT || \ + ANALOG_SUPPORT || \ + BH1750_SUPPORT || \ + BMP180_SUPPORT || \ + BMX280_SUPPORT || \ + CSE7766_SUPPORT || \ + DALLAS_SUPPORT || \ + DHT_SUPPORT || \ + DIGITAL_SUPPORT || \ + ECH1560_SUPPORT || \ + EMON_ADC121_SUPPORT || \ + EMON_ADS1X15_SUPPORT || \ + EMON_ANALOG_SUPPORT || \ + EVENTS_SUPPORT || \ + EZOPH_SUPPORT || \ + GEIGER_SUPPORT || \ + GUVAS12SD_SUPPORT || \ + HLW8012_SUPPORT || \ + LDR_SUPPORT || \ + MAX6675_SUPPORT || \ + MHZ19_SUPPORT || \ + MICS2710_SUPPORT || \ + MICS5525_SUPPORT || \ + NTC_SUPPORT || \ + PMSX003_SUPPORT || \ + PULSEMETER_SUPPORT || \ + PZEM004T_SUPPORT || \ + SDS011_SUPPORT || \ + SENSEAIR_SUPPORT || \ + SHT3X_I2C_SUPPORT || \ + SI7021_SUPPORT || \ + SONAR_SUPPORT || \ + T6613_SUPPORT || \ + THERMOSTAT_SUPPORT || \ + TMP3X_SUPPORT || \ + V9261F_SUPPORT || \ + VEML6075_SUPPORT || \ + VL53L1X_SUPPORT \ +) #endif -#endif // SENSOR_SUPPORT diff --git a/code/espurna/led_config.h b/code/espurna/led_config.h index 5a8bc692..443aa5d0 100644 --- a/code/espurna/led_config.h +++ b/code/espurna/led_config.h @@ -41,7 +41,7 @@ constexpr const unsigned char _ledRelay(unsigned char index) { (index == 4) ? (LED5_RELAY - 1) : (index == 5) ? (LED6_RELAY - 1) : (index == 6) ? (LED7_RELAY - 1) : - (index == 7) ? (LED8_RELAY - 1) : 0 + (index == 7) ? (LED8_RELAY - 1) : RELAY_NONE ); } diff --git a/code/espurna/sensor.ino b/code/espurna/sensor.ino index 9acf95ed..14f8b61c 100644 --- a/code/espurna/sensor.ino +++ b/code/espurna/sensor.ino @@ -9,18 +9,173 @@ Copyright (C) 2016-2019 by Xose Pérez #if SENSOR_SUPPORT #include +#include + +#include "relay.h" +#include "broker.h" +#include "ws.h" + +//-------------------------------------------------------------------------------- + #include "filters/LastFilter.h" #include "filters/MaxFilter.h" #include "filters/MedianFilter.h" #include "filters/MovingAverageFilter.h" #include "sensors/BaseSensor.h" -#include +#if AM2320_SUPPORT + #include "sensors/AM2320Sensor.h" +#endif -#include "relay.h" -#include "broker.h" -#include "ws.h" +#if ANALOG_SUPPORT + #include "sensors/AnalogSensor.h" +#endif + +#if BH1750_SUPPORT + #include "sensors/BH1750Sensor.h" +#endif + +#if BMP180_SUPPORT + #include "sensors/BMP180Sensor.h" +#endif + +#if BMX280_SUPPORT + #include "sensors/BMX280Sensor.h" +#endif + +#if CSE7766_SUPPORT + #include "sensors/CSE7766Sensor.h" +#endif + +#if DALLAS_SUPPORT + #include "sensors/DallasSensor.h" +#endif + +#if DHT_SUPPORT + #include "sensors/DHTSensor.h" +#endif + +#if DIGITAL_SUPPORT + #include "sensors/DigitalSensor.h" +#endif + +#if ECH1560_SUPPORT + #include "sensors/ECH1560Sensor.h" +#endif + +#if EMON_ADC121_SUPPORT + #include "sensors/EmonADC121Sensor.h" +#endif + +#if EMON_ADS1X15_SUPPORT + #include "sensors/EmonADS1X15Sensor.h" +#endif + +#if EMON_ANALOG_SUPPORT + #include "sensors/EmonAnalogSensor.h" +#endif + +#if EVENTS_SUPPORT + #include "sensors/EventSensor.h" +#endif + +#if EZOPH_SUPPORT + #include "sensors/EZOPHSensor.h" +#endif + +#if GEIGER_SUPPORT + #include "sensors/GeigerSensor.h" +#endif + +#if GUVAS12SD_SUPPORT + #include "sensors/GUVAS12SDSensor.h" +#endif + +#if HLW8012_SUPPORT + #include "sensors/HLW8012Sensor.h" +#endif + +#if LDR_SUPPORT + #include "sensors/LDRSensor.h" +#endif + +#if MAX6675_SUPPORT + #include "sensors/MAX6675Sensor.h" +#endif + +#if MICS2710_SUPPORT + #include "sensors/MICS2710Sensor.h" +#endif + +#if MICS5525_SUPPORT + #include "sensors/MICS5525Sensor.h" +#endif + +#if MHZ19_SUPPORT + #include "sensors/MHZ19Sensor.h" +#endif + +#if NTC_SUPPORT + #include "sensors/NTCSensor.h" +#endif + +#if SDS011_SUPPORT + #include "sensors/SDS011Sensor.h" +#endif + +#if SENSEAIR_SUPPORT + #include "sensors/SenseAirSensor.h" +#endif + +#if PMSX003_SUPPORT + #include "sensors/PMSX003Sensor.h" +#endif + +#if PULSEMETER_SUPPORT + #include "sensors/PulseMeterSensor.h" +#endif + +#if PZEM004T_SUPPORT + #include "sensors/PZEM004TSensor.h" +#endif + +#if SHT3X_I2C_SUPPORT + #include "sensors/SHT3XI2CSensor.h" +#endif + +#if SI7021_SUPPORT + #include "sensors/SI7021Sensor.h" +#endif + +#if SONAR_SUPPORT + #include "sensors/SonarSensor.h" +#endif + +#if T6613_SUPPORT + #include "sensors/T6613Sensor.h" +#endif + +#if TMP3X_SUPPORT + #include "sensors/TMP3XSensor.h" +#endif + +#if V9261F_SUPPORT + #include "sensors/V9261FSensor.h" +#endif + +#if VEML6075_SUPPORT + #include "sensors/VEML6075Sensor.h" +#endif + +#if VL53L1X_SUPPORT + #include "sensors/VL53L1XSensor.h" +#endif + +#if ADE7953_SUPPORT + #include "sensors/ADE7953Sensor.h" +#endif +//-------------------------------------------------------------------------------- struct sensor_magnitude_t { BaseSensor * sensor; // Sensor object diff --git a/code/espurna/sensors/ADE7953Sensor.h b/code/espurna/sensors/ADE7953Sensor.h index 4ecb6293..5e5bccb3 100644 --- a/code/espurna/sensors/ADE7953Sensor.h +++ b/code/espurna/sensors/ADE7953Sensor.h @@ -8,9 +8,6 @@ #pragma once -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. - #include #include diff --git a/code/espurna/sensors/AM2320Sensor.h b/code/espurna/sensors/AM2320Sensor.h index 80924bf3..ff27d977 100644 --- a/code/espurna/sensors/AM2320Sensor.h +++ b/code/espurna/sensors/AM2320Sensor.h @@ -7,10 +7,8 @@ #pragma once -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. +#include -#include "Arduino.h" #include "I2CSensor.h" // https://akizukidenshi.com/download/ds/aosong/AM2320.pdf diff --git a/code/espurna/sensors/AnalogSensor.h b/code/espurna/sensors/AnalogSensor.h index c8f12be8..36537483 100644 --- a/code/espurna/sensors/AnalogSensor.h +++ b/code/espurna/sensors/AnalogSensor.h @@ -7,11 +7,9 @@ #pragma once -// Set ADC to TOUT pin -#undef ADC_MODE_VALUE -#define ADC_MODE_VALUE ADC_TOUT +#include -#include "Arduino.h" +#include "../debug.h" #include "BaseSensor.h" class AnalogSensor : public BaseSensor { diff --git a/code/espurna/sensors/BH1750Sensor.h b/code/espurna/sensors/BH1750Sensor.h index 4d16d89e..3a7d091d 100644 --- a/code/espurna/sensors/BH1750Sensor.h +++ b/code/espurna/sensors/BH1750Sensor.h @@ -7,10 +7,8 @@ #pragma once -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. +#include -#include "Arduino.h" #include "I2CSensor.h" #define BH1750_CONTINUOUS_HIGH_RES_MODE 0x10 // Start measurement at 1lx resolution. Measurement time is approx 120ms. diff --git a/code/espurna/sensors/BMP180Sensor.h b/code/espurna/sensors/BMP180Sensor.h index 58204054..c45a7d7c 100644 --- a/code/espurna/sensors/BMP180Sensor.h +++ b/code/espurna/sensors/BMP180Sensor.h @@ -7,13 +7,10 @@ #pragma once -#include "../utils.h" - -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. +#include -#include "Arduino.h" #include "I2CSensor.h" +#include "../utils.h" #define BMP180_CHIP_ID 0x55 diff --git a/code/espurna/sensors/BMX280Sensor.h b/code/espurna/sensors/BMX280Sensor.h index 4f781473..2dc881a3 100644 --- a/code/espurna/sensors/BMX280Sensor.h +++ b/code/espurna/sensors/BMX280Sensor.h @@ -7,13 +7,10 @@ #pragma once -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. - #include -#include "../utils.h" #include "I2CSensor.h" +#include "../utils.h" #define BMX280_CHIP_BMP280 0x58 #define BMX280_CHIP_BME280 0x60 diff --git a/code/espurna/sensors/CSE7766Sensor.h b/code/espurna/sensors/CSE7766Sensor.h index ffd4a9b9..b0c26f21 100644 --- a/code/espurna/sensors/CSE7766Sensor.h +++ b/code/espurna/sensors/CSE7766Sensor.h @@ -8,11 +8,12 @@ #pragma once -#include "Arduino.h" -#include "BaseSensor.h" - +#include #include +#include "../debug.h" +#include "BaseSensor.h" + class CSE7766Sensor : public BaseSensor { public: @@ -234,10 +235,10 @@ class CSE7766Sensor : public BaseSensor { if ((_data[0] & 0xFC) > 0xF0) { _error = SENSOR_ERROR_OTHER; #if SENSOR_DEBUG - if (0xF1 == _data[0] & 0xF1) DEBUG_MSG("[SENSOR] CSE7766: Abnormal coefficient storage area\n"); - if (0xF2 == _data[0] & 0xF2) DEBUG_MSG("[SENSOR] CSE7766: Power cycle exceeded range\n"); - if (0xF4 == _data[0] & 0xF4) DEBUG_MSG("[SENSOR] CSE7766: Current cycle exceeded range\n"); - if (0xF8 == _data[0] & 0xF8) DEBUG_MSG("[SENSOR] CSE7766: Voltage cycle exceeded range\n"); + if (0xF1 == (_data[0] & 0xF1)) DEBUG_MSG_P(PSTR("[SENSOR] CSE7766: Abnormal coefficient storage area\n")); + if (0xF2 == (_data[0] & 0xF2)) DEBUG_MSG_P(PSTR("[SENSOR] CSE7766: Power cycle exceeded range\n")); + if (0xF4 == (_data[0] & 0xF4)) DEBUG_MSG_P(PSTR("[SENSOR] CSE7766: Current cycle exceeded range\n")); + if (0xF8 == (_data[0] & 0xF8)) DEBUG_MSG_P(PSTR("[SENSOR] CSE7766: Voltage cycle exceeded range\n")); #endif return; } diff --git a/code/espurna/sensors/DallasSensor.h b/code/espurna/sensors/DallasSensor.h index 810de25c..ca5218aa 100644 --- a/code/espurna/sensors/DallasSensor.h +++ b/code/espurna/sensors/DallasSensor.h @@ -8,11 +8,13 @@ #pragma once -#include "Arduino.h" -#include "BaseSensor.h" -#include +#include #include +#include + +#include "BaseSensor.h" + #define DS_CHIP_DS18S20 0x10 #define DS_CHIP_DS1822 0x22 #define DS_CHIP_DS18B20 0x28 diff --git a/code/espurna/sensors/DigitalSensor.h b/code/espurna/sensors/DigitalSensor.h index 96fcff1e..fd9c0191 100644 --- a/code/espurna/sensors/DigitalSensor.h +++ b/code/espurna/sensors/DigitalSensor.h @@ -7,7 +7,8 @@ #pragma once -#include "Arduino.h" +#include + #include "BaseSensor.h" class DigitalSensor : public BaseSensor { diff --git a/code/espurna/sensors/ECH1560Sensor.h b/code/espurna/sensors/ECH1560Sensor.h index a8a34648..05290f6d 100644 --- a/code/espurna/sensors/ECH1560Sensor.h +++ b/code/espurna/sensors/ECH1560Sensor.h @@ -7,7 +7,9 @@ #pragma once -#include "Arduino.h" +#include + +#include "../debug.h" #include "BaseSensor.h" class ECH1560Sensor : public BaseSensor { diff --git a/code/espurna/sensors/EZOPHSensor.h b/code/espurna/sensors/EZOPHSensor.h index d6dbaf0c..7d6ec44c 100644 --- a/code/espurna/sensors/EZOPHSensor.h +++ b/code/espurna/sensors/EZOPHSensor.h @@ -9,10 +9,11 @@ #pragma once -#include "Arduino.h" -#include "BaseSensor.h" +#include #include +#include "BaseSensor.h" + class EZOPHSensor : public BaseSensor { public: diff --git a/code/espurna/sensors/EmonADS1X15Sensor.h b/code/espurna/sensors/EmonADS1X15Sensor.h index f4ff075a..0f607958 100644 --- a/code/espurna/sensors/EmonADS1X15Sensor.h +++ b/code/espurna/sensors/EmonADS1X15Sensor.h @@ -7,9 +7,11 @@ #pragma once -#include "Arduino.h" +#include + #include "EmonSensor.h" + #define ADS1X15_CHANNELS (4) #define ADS1X15_CHIP_ADS1015 (0) diff --git a/code/espurna/sensors/EmonAnalogSensor.h b/code/espurna/sensors/EmonAnalogSensor.h index 97b19043..9255ca18 100644 --- a/code/espurna/sensors/EmonAnalogSensor.h +++ b/code/espurna/sensors/EmonAnalogSensor.h @@ -7,11 +7,8 @@ #pragma once -// Set ADC to TOUT pin -#undef ADC_MODE_VALUE -#define ADC_MODE_VALUE ADC_TOUT +#include -#include "Arduino.h" #include "EmonSensor.h" #define EMON_ANALOG_RESOLUTION 10 diff --git a/code/espurna/sensors/EmonSensor.h b/code/espurna/sensors/EmonSensor.h index 2682392d..5ae88e50 100644 --- a/code/espurna/sensors/EmonSensor.h +++ b/code/espurna/sensors/EmonSensor.h @@ -7,13 +7,12 @@ #pragma once -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. +#include -#include "Arduino.h" +#include "../debug.h" #include "I2CSensor.h" extern "C" { - #include "libs/fs_math.h" + #include "../libs/fs_math.h" } class EmonSensor : public I2CSensor { diff --git a/code/espurna/sensors/EventSensor.h b/code/espurna/sensors/EventSensor.h index d12671a4..fa9f8ab4 100644 --- a/code/espurna/sensors/EventSensor.h +++ b/code/espurna/sensors/EventSensor.h @@ -7,7 +7,9 @@ #pragma once -#include "Arduino.h" +#include + +#include "../debug.h" #include "BaseSensor.h" // we are bound by usable GPIOs diff --git a/code/espurna/sensors/GUVAS12SDSensor.h b/code/espurna/sensors/GUVAS12SDSensor.h index 0c93dca5..6d459b7a 100644 --- a/code/espurna/sensors/GUVAS12SDSensor.h +++ b/code/espurna/sensors/GUVAS12SDSensor.h @@ -8,14 +8,10 @@ #pragma once -// Set ADC to TOUT pin -#undef ADC_MODE_VALUE -#define ADC_MODE_VALUE ADC_TOUT - #include -#include "../utils.h" #include "BaseSensor.h" +#include "../utils.h" // http://www.eoc-inc.com/genicom/GUVA-S12SD.pdf // diff --git a/code/espurna/sensors/GeigerSensor.h b/code/espurna/sensors/GeigerSensor.h index 42a00c72..af3bd8b1 100644 --- a/code/espurna/sensors/GeigerSensor.h +++ b/code/espurna/sensors/GeigerSensor.h @@ -8,7 +8,9 @@ #pragma once -#include "Arduino.h" +#include + +#include "../debug.h" #include "BaseSensor.h" class GeigerSensor : public BaseSensor { @@ -131,38 +133,37 @@ unsigned char type(unsigned char index) { // Current value for slot # index double value(unsigned char index) { unsigned char i=0; - #if GEIGER_REPORT_CPM + #if GEIGER_REPORT_CPM if (index == i++) { unsigned long _period_begin = _lastreport_cpm; _lastreport_cpm = millis(); double value = _events * 60000; value = value / (_lastreport_cpm-_period_begin); #if SENSOR_DEBUG - char data[128]; char buffer[32]; - dtostrf(value, 1, 4, buffer); - snprintf(data, sizeof(data), "Ticks: %u | Interval: %u | CPM: %s", _ticks, (_lastreport_cpm-_period_begin), buffer); - DEBUG_MSG("[GEIGER] %s\n", data); + char buffer[32] = {0}; + dtostrf(value, 1, 4, buffer); + + DEBUG_MSG_P(PSTR("[GEIGER] Ticks: %u | Interval: %u | CPM: %s\n"), _ticks, (_lastreport_cpm - _period_begin), buffer); #endif _events = 0; return value; } - #endif - #if GEIGER_REPORT_SIEVERTS + #endif + #if GEIGER_REPORT_SIEVERTS if (index == i++) { unsigned long _period_begin = _lastreport_sv; _lastreport_sv = millis(); double value = _ticks * 60000 / _cpm2sievert; value = value / (_lastreport_sv-_period_begin); #if SENSOR_DEBUG - char data[128]; char buffer[32]; - dtostrf(value, 1, 4, buffer); - snprintf(data, sizeof(data), "Ticks: %u | Interval: %u | µSievert: %s", _ticks, (_lastreport_sv-_period_begin), buffer); - DEBUG_MSG("[GEIGER] %s\n", data); + char buffer[32] = {0}; + dtostrf(value, 1, 4, buffer); + DEBUG_MSG_P(PSTR("[GEIGER] Ticks: %u | Interval: %u | CPM: %s\n"), _ticks, (_lastreport_cpm - _period_begin), buffer); #endif _ticks = 0; return value; } - #endif + #endif return 0; } diff --git a/code/espurna/sensors/HLW8012Sensor.h b/code/espurna/sensors/HLW8012Sensor.h index dfca015e..0eeb58a1 100644 --- a/code/espurna/sensors/HLW8012Sensor.h +++ b/code/espurna/sensors/HLW8012Sensor.h @@ -7,10 +7,12 @@ #pragma once -#include "Arduino.h" -#include "BaseSensor.h" +#include #include +#include "../debug.h" +#include "BaseSensor.h" + class HLW8012Sensor : public BaseSensor { public: diff --git a/code/espurna/sensors/LDRSensor.h b/code/espurna/sensors/LDRSensor.h index 2404ae28..f7361478 100644 --- a/code/espurna/sensors/LDRSensor.h +++ b/code/espurna/sensors/LDRSensor.h @@ -7,12 +7,12 @@ #pragma once -// Set ADC to TOUT pin -#undef ADC_MODE_VALUE -#define ADC_MODE_VALUE ADC_TOUT +#include -#include "Arduino.h" #include "AnalogSensor.h" +extern "C" { + #include "../libs/fs_math.h" +} #define LDR_GL5516 1 #define LDR_GL5528 2 @@ -22,10 +22,6 @@ #define LDR_GL5549 6 #define LDR_OTHER 99 -extern "C" { - #include "../libs/fs_math.h" -} - class LDRSensor : public AnalogSensor { public: diff --git a/code/espurna/sensors/MAX6675Sensor.h b/code/espurna/sensors/MAX6675Sensor.h index 41e4a9e9..4ae87cd5 100644 --- a/code/espurna/sensors/MAX6675Sensor.h +++ b/code/espurna/sensors/MAX6675Sensor.h @@ -8,11 +8,13 @@ #pragma once -#include "Arduino.h" -#include "BaseSensor.h" -#include +#include #include +#include + +#include "BaseSensor.h" + #define MAX6675_READ_INTERVAL 3000 class MAX6675Sensor : public BaseSensor { diff --git a/code/espurna/sensors/MHZ19Sensor.h b/code/espurna/sensors/MHZ19Sensor.h index acd916b6..65181ada 100644 --- a/code/espurna/sensors/MHZ19Sensor.h +++ b/code/espurna/sensors/MHZ19Sensor.h @@ -10,10 +10,11 @@ #pragma once -#include "Arduino.h" -#include "BaseSensor.h" +#include #include +#include "BaseSensor.h" + #define MHZ19_REQUEST_LEN 8 #define MHZ19_RESPONSE_LEN 9 #define MHZ19_TIMEOUT 1000 diff --git a/code/espurna/sensors/MICS2710Sensor.h b/code/espurna/sensors/MICS2710Sensor.h index bb9b2168..1731771a 100644 --- a/code/espurna/sensors/MICS2710Sensor.h +++ b/code/espurna/sensors/MICS2710Sensor.h @@ -7,13 +7,9 @@ #pragma once -// Set ADC to TOUT pin -#undef ADC_MODE_VALUE -#define ADC_MODE_VALUE ADC_TOUT +#include -#include "Arduino.h" #include "BaseSensor.h" - extern "C" { #include "../libs/fs_math.h" } diff --git a/code/espurna/sensors/MICS5525Sensor.h b/code/espurna/sensors/MICS5525Sensor.h index 91ceda83..321947b0 100644 --- a/code/espurna/sensors/MICS5525Sensor.h +++ b/code/espurna/sensors/MICS5525Sensor.h @@ -7,13 +7,9 @@ #pragma once -// Set ADC to TOUT pin -#undef ADC_MODE_VALUE -#define ADC_MODE_VALUE ADC_TOUT +#include -#include "Arduino.h" #include "BaseSensor.h" - extern "C" { #include "../libs/fs_math.h" } diff --git a/code/espurna/sensors/NTCSensor.h b/code/espurna/sensors/NTCSensor.h index c643f0d7..2e4fa6e9 100644 --- a/code/espurna/sensors/NTCSensor.h +++ b/code/espurna/sensors/NTCSensor.h @@ -7,13 +7,9 @@ #pragma once -// Set ADC to TOUT pin -#undef ADC_MODE_VALUE -#define ADC_MODE_VALUE ADC_TOUT +#include -#include "Arduino.h" #include "AnalogSensor.h" - extern "C" { #include "../libs/fs_math.h" } diff --git a/code/espurna/sensors/PMSX003Sensor.h b/code/espurna/sensors/PMSX003Sensor.h index cf235982..3e46b4e3 100644 --- a/code/espurna/sensors/PMSX003Sensor.h +++ b/code/espurna/sensors/PMSX003Sensor.h @@ -9,11 +9,12 @@ #pragma once -#include "Arduino.h" -#include "BaseSensor.h" - +#include #include +#include "../debug.h" +#include "BaseSensor.h" + // Generic data #define PMS_BAUD_RATE 9600 diff --git a/code/espurna/sensors/PZEM004TSensor.h b/code/espurna/sensors/PZEM004TSensor.h index e6edf873..6769a4ee 100644 --- a/code/espurna/sensors/PZEM004TSensor.h +++ b/code/espurna/sensors/PZEM004TSensor.h @@ -49,10 +49,11 @@ #pragma once -#include "Arduino.h" +#include +#include + #include "BaseSensor.h" -#include #define PZ_MAGNITUDE_COUNT 4 diff --git a/code/espurna/sensors/PulseMeterSensor.h b/code/espurna/sensors/PulseMeterSensor.h index d3012890..d90960e1 100644 --- a/code/espurna/sensors/PulseMeterSensor.h +++ b/code/espurna/sensors/PulseMeterSensor.h @@ -7,7 +7,9 @@ #pragma once -#include "Arduino.h" +#include + +#include "../debug.h" #include "BaseSensor.h" class PulseMeterSensor : public BaseSensor { diff --git a/code/espurna/sensors/SDS011Sensor.h b/code/espurna/sensors/SDS011Sensor.h index 477af425..bb022560 100644 --- a/code/espurna/sensors/SDS011Sensor.h +++ b/code/espurna/sensors/SDS011Sensor.h @@ -10,10 +10,11 @@ #pragma once -#include "Arduino.h" -#include "BaseSensor.h" +#include #include +#include "BaseSensor.h" + class SDS011Sensor : public BaseSensor { @@ -125,7 +126,7 @@ class SDS011Sensor : public BaseSensor { int len = 0; int pm10_serial = 0; int pm25_serial = 0; - int checksum_is; + int checksum_is = 0; int checksum_ok = 0; while ((_serial->available() > 0) && (_serial->available() >= (10-len))) { diff --git a/code/espurna/sensors/SHT3XI2CSensor.h b/code/espurna/sensors/SHT3XI2CSensor.h index 5c4c1cc0..00b1ba07 100644 --- a/code/espurna/sensors/SHT3XI2CSensor.h +++ b/code/espurna/sensors/SHT3XI2CSensor.h @@ -7,13 +7,10 @@ #pragma once -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. - #include -#include "../utils.h" #include "I2CSensor.h" +#include "../utils.h" class SHT3XI2CSensor : public I2CSensor { diff --git a/code/espurna/sensors/SI7021Sensor.h b/code/espurna/sensors/SI7021Sensor.h index a634d477..76c3ae28 100644 --- a/code/espurna/sensors/SI7021Sensor.h +++ b/code/espurna/sensors/SI7021Sensor.h @@ -7,13 +7,10 @@ #pragma once -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. - #include -#include "../utils.h" #include "I2CSensor.h" +#include "../utils.h" #define SI7021_SCL_FREQUENCY 200 diff --git a/code/espurna/sensors/SenseAirSensor.h b/code/espurna/sensors/SenseAirSensor.h index f0dfe8e2..90f94a90 100644 --- a/code/espurna/sensors/SenseAirSensor.h +++ b/code/espurna/sensors/SenseAirSensor.h @@ -8,10 +8,11 @@ #pragma once -#include "Arduino.h" +#include +#include + #include "BaseSensor.h" -#include // SenseAir sensor utils class SenseAir diff --git a/code/espurna/sensors/SonarSensor.h b/code/espurna/sensors/SonarSensor.h index b5d1cc5a..7efa8388 100644 --- a/code/espurna/sensors/SonarSensor.h +++ b/code/espurna/sensors/SonarSensor.h @@ -8,9 +8,10 @@ #pragma once -#include "Arduino.h" +#include +#include + #include "BaseSensor.h" -#include "NewPing.h" class SonarSensor : public BaseSensor { diff --git a/code/espurna/sensors/T6613Sensor.h b/code/espurna/sensors/T6613Sensor.h index 97ab6136..b261e19e 100644 --- a/code/espurna/sensors/T6613Sensor.h +++ b/code/espurna/sensors/T6613Sensor.h @@ -9,10 +9,12 @@ #pragma once -#include "Arduino.h" -#include "BaseSensor.h" +#include #include +#include "BaseSensor.h" + + #define T6613_REQUEST_LEN 5 #define T6613_RESPONSE_LEN 5 #define T6613_TIMEOUT 1000 diff --git a/code/espurna/sensors/TMP3XSensor.h b/code/espurna/sensors/TMP3XSensor.h index d177e554..70bd9cdf 100644 --- a/code/espurna/sensors/TMP3XSensor.h +++ b/code/espurna/sensors/TMP3XSensor.h @@ -7,11 +7,8 @@ #pragma once -// Set ADC to TOUT pin -#undef ADC_MODE_VALUE -#define ADC_MODE_VALUE ADC_TOUT +#include -#include "Arduino.h" #include "BaseSensor.h" #define TMP3X_TMP35 35 diff --git a/code/espurna/sensors/V9261FSensor.h b/code/espurna/sensors/V9261FSensor.h index d95f7bef..24ae67cc 100644 --- a/code/espurna/sensors/V9261FSensor.h +++ b/code/espurna/sensors/V9261FSensor.h @@ -7,14 +7,14 @@ #pragma once -#include "Arduino.h" +#include +#include + #include "BaseSensor.h" extern "C" { - #include "libs/fs_math.h" + #include "../libs/fs_math.h" } -#include - class V9261FSensor : public BaseSensor { public: diff --git a/code/espurna/sensors/VEML6075Sensor.h b/code/espurna/sensors/VEML6075Sensor.h index b980b03d..f96f0137 100644 --- a/code/espurna/sensors/VEML6075Sensor.h +++ b/code/espurna/sensors/VEML6075Sensor.h @@ -7,13 +7,10 @@ #pragma once -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. +#include +#include - -#include "Arduino.h" #include "I2CSensor.h" -#include "SparkFun_VEML6075_Arduino_Library.h" class VEML6075Sensor : public I2CSensor { diff --git a/code/espurna/sensors/VL53L1XSensor.h b/code/espurna/sensors/VL53L1XSensor.h index 3ed04b06..504381f3 100644 --- a/code/espurna/sensors/VL53L1XSensor.h +++ b/code/espurna/sensors/VL53L1XSensor.h @@ -7,13 +7,10 @@ #pragma once -#undef I2C_SUPPORT -#define I2C_SUPPORT 1 // Explicitly request I2C support. +#include +#include - -#include "Arduino.h" #include "I2CSensor.h" -#include "VL53L1X.h" class VL53L1XSensor : public I2CSensor { diff --git a/code/test/build/emon.h b/code/test/build/emon.h index 4d865368..22146d9a 100644 --- a/code/test/build/emon.h +++ b/code/test/build/emon.h @@ -1,10 +1,10 @@ +#define ADE7953_SUPPORT 1 +#define CSE7766_SUPPORT 1 +#define ECH1560_SUPPORT 1 #define EMON_ADC121_SUPPORT 1 #define EMON_ADS1X15_SUPPORT 1 -#define CSE7766_SUPPORT 1 -#define PZEM004T_SUPPORT 1 +#define EMON_ANALOG_SUPPORT 1 #define HLW8012_SUPPORT 1 -#define ECH1560_SUPPORT 1 #define PULSEMETER_SUPPORT 1 +#define PZEM004T_SUPPORT 1 #define V9261F_SUPPORT 1 -#define ADE7953_SUPPORT 1 -#define EMON_ANALOG_SUPPORT 1 diff --git a/code/test/build/sensor.h b/code/test/build/sensor.h index 6df9ee66..9a8f6c0f 100644 --- a/code/test/build/sensor.h +++ b/code/test/build/sensor.h @@ -1,25 +1,29 @@ #define AM2320_SUPPORT 1 +#define ANALOG_SUPPORT 1 #define BH1750_SUPPORT 1 #define BMP180_SUPPORT 1 #define BMX280_SUPPORT 1 -#define SHT3X_I2C_SUPPORT 1 -#define SHT3X_I2C_SUPPORT 1 -#define SI7021_SUPPORT 1 -#define PMSX003_SUPPORT 1 -#define SENSEAIR_SUPPORT 1 -#define VL53L1X_SUPPORT 1 #define DALLAS_SUPPORT 1 -#define MICS2710_SUPPORT 1 -#define MICS5525_SUPPORT 1 -#define MAX6675_SUPPORT 1 #define DHT_SUPPORT 1 -#define T6613_SUPPORT 1 -#define TMP3X_SUPPORT 1 -#define EVENTS_SUPPORT 1 #define DIGITAL_SUPPORT 1 -#define SONAR_SUPPORT 1 +#define EVENTS_SUPPORT 1 +#define EZOPH_SUPPORT 1 +#define GEIGER_SUPPORT 1 +#define GUVAS12SD_SUPPORT 1 +#define LDR_SUPPORT 1 +#define MAX6675_SUPPORT 1 #define MHZ19_SUPPORT 1 +#define MICS2710_SUPPORT 1 +#define MICS5525_SUPPORT 1 #define NTC_SUPPORT 1 -#define LDR_SUPPORT 1 -#define GUVAS12SD_SUPPORT 1 +#define PMSX003_SUPPORT 1 +#define SDS011_SUPPORT 1 +#define SENSEAIR_SUPPORT 1 +#define SHT3X_I2C_SUPPORT 1 +#define SI7021_SUPPORT 1 +#define SONAR_SUPPORT 1 +#define T6613_SUPPORT 1 #define THERMOSTAT_SUPPORT 1 +#define TMP3X_SUPPORT 1 +#define VEML6075_SUPPORT 1 +#define VL53L1X_SUPPORT 1