From 07ddb70afd0c29211138191c51785592b3ba1216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sun, 2 Sep 2018 12:01:20 +0200 Subject: [PATCH] Addind SDS011 to arduino.h and progmem.h --- code/espurna/config/arduino.h | 2 ++ code/espurna/config/progmem.h | 3 +++ code/espurna/config/sensors.h | 46 +++++++++++++++++------------------ 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index f614a8ef..fe03a421 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -160,6 +160,8 @@ //#define NTC_SUPPORT 1 //#define PMSX003_SUPPORT 1 //#define PZEM004T_SUPPORT 1 +//#define SDS011_SUPPORT 1 +//#define SENSEAIR_SUPPORT 1 //#define SHT3X_I2C_SUPPORT 1 //#define SI7021_SUPPORT 1 //#define SONAR_SUPPORT 1 diff --git a/code/espurna/config/progmem.h b/code/espurna/config/progmem.h index f370070c..c36671b6 100644 --- a/code/espurna/config/progmem.h +++ b/code/espurna/config/progmem.h @@ -196,6 +196,9 @@ PROGMEM const char espurna_sensors[] = #if PZEM004T_SUPPORT "PZEM004T " #endif + #if SDS011_SUPPORT + "SDS011 " + #endif #if SENSEAIR_SUPPORT "SENSEAIR " #endif diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index 3ce23a69..7e25eb04 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -430,23 +430,6 @@ #define MHZ19_TX_PIN 15 #endif -//------------------------------------------------------------------------------ -// SDS011 particulates sensor -// Enable support by passing SDS011_SUPPORT=1 build flag -//------------------------------------------------------------------------------ - -#ifndef SDS011_SUPPORT -#define SDS011_SUPPORT 0 -#endif - -#ifndef SDS011_RX_PIN -#define SDS011_RX_PIN 14 -#endif - -#ifndef SDS011_TX_PIN -#define SDS011_TX_PIN 12 -#endif - //------------------------------------------------------------------------------ // NTC sensor // Enable support by passing NTC_SUPPORT=1 build flag @@ -484,6 +467,23 @@ #define NTC_BETA 3977 // Beta coeficient #endif +//------------------------------------------------------------------------------ +// SDS011 particulates sensor +// Enable support by passing SDS011_SUPPORT=1 build flag +//------------------------------------------------------------------------------ + +#ifndef SDS011_SUPPORT +#define SDS011_SUPPORT 0 +#endif + +#ifndef SDS011_RX_PIN +#define SDS011_RX_PIN 14 +#endif + +#ifndef SDS011_TX_PIN +#define SDS011_TX_PIN 12 +#endif + //------------------------------------------------------------------------------ // SenseAir CO2 sensor // Enable support by passing SENSEAIR_SUPPORT=1 build flag @@ -674,8 +674,8 @@ GUVAS12SD_SUPPORT || \ HLW8012_SUPPORT || \ MHZ19_SUPPORT || \ - SDS011_SUPPORT || \ NTC_SUPPORT || \ + SDS011_SUPPORT || \ SENSEAIR_SUPPORT || \ PMSX003_SUPPORT || \ PZEM004T_SUPPORT || \ @@ -803,16 +803,16 @@ #include "../sensors/MHZ19Sensor.h" #endif -#if SDS011_SUPPORT - #include - #include "../sensors/SDS011Sensor.h" -#endif - #if NTC_SUPPORT #include "../sensors/AnalogSensor.h" #include "../sensors/NTCSensor.h" #endif +#if SDS011_SUPPORT + #include + #include "../sensors/SDS011Sensor.h" +#endif + #if SENSEAIR_SUPPORT #include #include "../sensors/SenseAirSensor.h"