From 7ebd4f46325961b9d3bb2392d99b33eff79ddb90 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Sat, 16 Mar 2024 14:20:34 +0100 Subject: [PATCH] clean up defaults.h * remove duplicated #defines. this is most probably a merge error from 2024-01-16, as evidenced by 63205f88b, which added these duplicates. * sort values by upstream and downstream projects. add a comment which tells us in the future where OpenDTU-OnBattery-specific values start. --- include/defaults.h | 59 ++++------------------------------------------ 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/include/defaults.h b/include/defaults.h index c30cb32e2..818c556b6 100644 --- a/include/defaults.h +++ b/include/defaults.h @@ -104,59 +104,11 @@ #define REACHABLE_THRESHOLD 2U -#define MAX_INVERTER_LIMIT 2250 -#define VEDIRECT_ENABLED false -#define VEDIRECT_VERBOSE_LOGGING false -#define VEDIRECT_UPDATESONLY true - -#define POWERMETER_ENABLED false -#define POWERMETER_INTERVAL 10 -#define POWERMETER_SOURCE 2 -#define POWERMETER_SDMBAUDRATE 9600 -#define POWERMETER_SDMADDRESS 1 - - -#define POWERLIMITER_ENABLED false -#define POWERLIMITER_SOLAR_PASSTHROUGH_ENABLED true -#define POWERLIMITER_SOLAR_PASSTHROUGH_LOSSES 3 -#define POWERLIMITER_BATTERY_DRAIN_STRATEGY 0 -#define POWERLIMITER_INTERVAL 10 -#define POWERLIMITER_IS_INVERTER_BEHIND_POWER_METER true -#define POWERLIMITER_IS_INVERTER_SOLAR_POWERED false -#define POWERLIMITER_INVERTER_ID 0 -#define POWERLIMITER_INVERTER_CHANNEL_ID 0 -#define POWERLIMITER_TARGET_POWER_CONSUMPTION 0 -#define POWERLIMITER_TARGET_POWER_CONSUMPTION_HYSTERESIS 0 -#define POWERLIMITER_LOWER_POWER_LIMIT 10 -#define POWERLIMITER_UPPER_POWER_LIMIT 800 -#define POWERLIMITER_IGNORE_SOC false -#define POWERLIMITER_BATTERY_SOC_START_THRESHOLD 80 -#define POWERLIMITER_BATTERY_SOC_STOP_THRESHOLD 20 -#define POWERLIMITER_VOLTAGE_START_THRESHOLD 50.0 -#define POWERLIMITER_VOLTAGE_STOP_THRESHOLD 49.0 -#define POWERLIMITER_VOLTAGE_LOAD_CORRECTION_FACTOR 0.001 -#define POWERLIMITER_RESTART_HOUR -1 -#define POWERLIMITER_FULL_SOLAR_PASSTHROUGH_SOC 100 -#define POWERLIMITER_FULL_SOLAR_PASSTHROUGH_START_VOLTAGE 100.0 -#define POWERLIMITER_FULL_SOLAR_PASSTHROUGH_STOP_VOLTAGE 100.0 - -#define BATTERY_ENABLED false -#define BATTERY_PROVIDER 0 // Pylontech CAN receiver -#define BATTERY_JKBMS_INTERFACE 0 -#define BATTERY_JKBMS_POLLING_INTERVAL 5 - -#define HUAWEI_ENABLED false -#define HUAWEI_CAN_CONTROLLER_FREQUENCY 8000000UL -#define HUAWEI_AUTO_POWER_VOLTAGE_LIMIT 42.0 -#define HUAWEI_AUTO_POWER_ENABLE_VOLTAGE_LIMIT 42.0 -#define HUAWEI_AUTO_POWER_LOWER_POWER_LIMIT 150 -#define HUAWEI_AUTO_POWER_UPPER_POWER_LIMIT 2000 - -#define VERBOSE_LOGGING true - #define LED_BRIGHTNESS 100U #define MAX_INVERTER_LIMIT 2250 + +// values specific to downstream project OpenDTU-OnBattery start here: #define VEDIRECT_ENABLED false #define VEDIRECT_VERBOSE_LOGGING false #define VEDIRECT_UPDATESONLY true @@ -167,19 +119,20 @@ #define POWERMETER_SDMBAUDRATE 9600 #define POWERMETER_SDMADDRESS 1 - #define POWERLIMITER_ENABLED false #define POWERLIMITER_SOLAR_PASSTHROUGH_ENABLED true #define POWERLIMITER_SOLAR_PASSTHROUGH_LOSSES 3 #define POWERLIMITER_BATTERY_DRAIN_STRATEGY 0 #define POWERLIMITER_INTERVAL 10 #define POWERLIMITER_IS_INVERTER_BEHIND_POWER_METER true +#define POWERLIMITER_IS_INVERTER_SOLAR_POWERED false #define POWERLIMITER_INVERTER_ID 0 #define POWERLIMITER_INVERTER_CHANNEL_ID 0 #define POWERLIMITER_TARGET_POWER_CONSUMPTION 0 #define POWERLIMITER_TARGET_POWER_CONSUMPTION_HYSTERESIS 0 #define POWERLIMITER_LOWER_POWER_LIMIT 10 #define POWERLIMITER_UPPER_POWER_LIMIT 800 +#define POWERLIMITER_IGNORE_SOC false #define POWERLIMITER_BATTERY_SOC_START_THRESHOLD 80 #define POWERLIMITER_BATTERY_SOC_STOP_THRESHOLD 20 #define POWERLIMITER_VOLTAGE_START_THRESHOLD 50.0 @@ -203,7 +156,3 @@ #define HUAWEI_AUTO_POWER_UPPER_POWER_LIMIT 2000 #define VERBOSE_LOGGING true - -#define LED_BRIGHTNESS 100U - -#define MAX_INVERTER_LIMIT 2250