From 7f8fc6754decf5a50f78358198e522adcde6a4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Thu, 28 Dec 2017 17:46:58 +0100 Subject: [PATCH] Allow to overwrite HLW8012 build settings --- code/espurna/config/sensors.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index ed419eb2..e3bd2d77 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -307,11 +307,23 @@ #define HLW8012_CF_PIN 14 #endif -#define HLW8012_USE_INTERRUPTS 1 // Use interrupts to trap HLW8012 signals +#ifndef HLW8012_SEL_CURRENT #define HLW8012_SEL_CURRENT HIGH // SEL pin to HIGH to measure current +#endif + +#ifndef HLW8012_CURRENT_R #define HLW8012_CURRENT_R 0.001 // Current resistor +#endif + +#ifndef HLW8012_VOLTAGE_R_UP #define HLW8012_VOLTAGE_R_UP ( 5 * 470000 ) // Upstream voltage resistor +#endif + +#ifndef HLW8012_VOLTAGE_R_DOWN #define HLW8012_VOLTAGE_R_DOWN ( 1000 ) // Downstream voltage resistor +#endif + +#define HLW8012_USE_INTERRUPTS 1 // Use interrupts to trap HLW8012 signals //------------------------------------------------------------------------------ // MHZ19 CO2 sensor