From 7494f9de517afbbdec17bc32a5dadbcb699f4fa7 Mon Sep 17 00:00:00 2001 From: Ollo Date: Thu, 28 Mar 2024 20:37:19 +0100 Subject: [PATCH] Different factor to read solar voltage between HW0.7 and HW0.10 --- esp32/include/ControllerConfiguration.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/esp32/include/ControllerConfiguration.h b/esp32/include/ControllerConfiguration.h index d604244..8a1ea42 100644 --- a/esp32/include/ControllerConfiguration.h +++ b/esp32/include/ControllerConfiguration.h @@ -122,11 +122,12 @@ #define FIRMWARE_BASENAME "PlantControl" #define FIRMWARE_NAME FIRMWARE_BASENAME FIRMWARE_FEATURE1 FIRMWARE_FEATURE2 +#define FIRMWARE_VERSIONNMUMBER "3.001" #ifdef HWREVISION07 - #define FIRMWARE_VERSION "3.01 HW0.7" + #define FIRMWARE_VERSION FIRMWARE_VERSIONNMUMBER " HW0.7" #else - #define FIRMWARE_VERSION "3.01 HW0.10b" + #define FIRMWARE_VERSION FIRMWARE_VERSIONNMUMBER " HW0.10b" #endif #define MOIST_SENSOR_MAX_FRQ 5200 // 60kHz (500Hz margin) @@ -135,7 +136,11 @@ #define ANALOG_SENSOR_MAX_MV 1300 //successive approximation of good range #define ANALOG_SENSOR_MIN_MV 100 //successive approximation of good range -#define SOLAR_VOLT_FACTOR 11 +#ifdef HWREVISION07 +#define SOLAR_VOLT_FACTOR (4.0306f) /**< 100k and 33k voltage dividor */ +#else +#define SOLAR_VOLT_FACTOR 11f +#endif #define BATTSENSOR_INDEX_SOLAR 0 #define BATTSENSOR_INDEX_BATTERY 1