From 777e7a845ce7f42ebc0b59692953e40263eef764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20P=C3=A9rez=20Ferro?= Date: Wed, 5 Dec 2018 11:34:57 +0100 Subject: [PATCH] Making Emon Sensor params overrideable (#1290) * Allowing Emon sensor parameters to be naturally overridden * blocking get adminPass for security reasons * Fixing missing 's' in adminPass blocked message * Revert "blocking get adminPass for security reasons" --- code/espurna/config/sensors.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index 9a1495e5..8d56a4e1 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -295,12 +295,28 @@ #define EMON_MAX_SAMPLES 1000 // Max number of samples to get #define EMON_MAX_TIME 250 // Max time in ms to sample #define EMON_FILTER_SPEED 512 // Mobile average filter speed -#define EMON_MAINS_VOLTAGE 230 // Mains voltage #define EMON_REFERENCE_VOLTAGE 3.3 // Reference voltage of the ADC + +#ifndef EMON_MAINS_VOLTAGE +#define EMON_MAINS_VOLTAGE 230 // Mains voltage +#endif + +#ifndef EMON_CURRENT_RATIO #define EMON_CURRENT_RATIO 30 // Current ratio in the clamp (30A/1V) +#endif + +#ifndef EMON_REPORT_CURRENT + #define EMON_REPORT_CURRENT 0 // Report current +#endif + +#ifndef EMON_REPORT_POWER #define EMON_REPORT_POWER 1 // Report power +#endif + +#ifndef EMON_REPORT_ENERGY #define EMON_REPORT_ENERGY 1 // Report energy +#endif //------------------------------------------------------------------------------ // Energy Monitor based on ADC121