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"