From 81fb3f0e649910c65c32b643e3b5157c10edf46f Mon Sep 17 00:00:00 2001 From: Lazar Obradovic Date: Wed, 11 Apr 2018 14:24:32 +0200 Subject: [PATCH] analog sensors and ADC_MODE --- code/espurna/config/sensors.h | 4 ---- code/espurna/sensors/EmonAnalogSensor.h | 4 ++++ code/espurna/sensors/GUVAS12SDSensor.h | 5 +++++ code/espurna/sensors/TMP3XSensor.h | 5 +++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index a7d6fb55..a0ede390 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -530,10 +530,6 @@ #define ADC_VCC_ENABLED 1 #endif -#if ADC_VCC_ENABLED - ADC_MODE(ADC_VCC); -#endif - //-------------------------------------------------------------------------------- // Class loading //-------------------------------------------------------------------------------- diff --git a/code/espurna/sensors/EmonAnalogSensor.h b/code/espurna/sensors/EmonAnalogSensor.h index bfc5a2f0..45cd481e 100644 --- a/code/espurna/sensors/EmonAnalogSensor.h +++ b/code/espurna/sensors/EmonAnalogSensor.h @@ -7,6 +7,10 @@ #pragma once +#if ADC_VCC_ENABLED + ADC_MODE(ADC_VCC); +#endif + #include "Arduino.h" #include "EmonSensor.h" diff --git a/code/espurna/sensors/GUVAS12SDSensor.h b/code/espurna/sensors/GUVAS12SDSensor.h index 1589196d..2d941975 100644 --- a/code/espurna/sensors/GUVAS12SDSensor.h +++ b/code/espurna/sensors/GUVAS12SDSensor.h @@ -8,6 +8,11 @@ #pragma once +#if ADC_VCC_ENABLED + ADC_MODE(ADC_VCC); +#endif + + #include "Arduino.h" #include "BaseSensor.h" diff --git a/code/espurna/sensors/TMP3XSensor.h b/code/espurna/sensors/TMP3XSensor.h index 7562654c..c20444da 100644 --- a/code/espurna/sensors/TMP3XSensor.h +++ b/code/espurna/sensors/TMP3XSensor.h @@ -7,6 +7,11 @@ #pragma once +#if ADC_VCC_ENABLED + ADC_MODE(ADC_VCC); +#endif + + #include "Arduino.h" #include "BaseSensor.h"