DC/DC and PWM switch configuration via DTS

As these settings are clearly hardware-specific, configuration was
moved from Kconfig (hidden symbols) to DTS. New bindings added.
This commit is contained in:
Martin Jäger
2020-05-06 12:53:26 +02:00
parent 64b771cd42
commit ab504e3dfa
31 changed files with 220 additions and 188 deletions
+5 -5
View File
@@ -99,12 +99,12 @@ void control_thread()
lv_terminal.update_bus_current_margins();
#if CONFIG_HAS_PWM_SWITCH
#if DT_COMPAT_PWM_SWITCH
//pwm_switch.control();
leds_set_charging(pwm_switch.active());
#endif
#if CONFIG_HAS_DCDC_CONVERTER
#if DT_COMPAT_DCDC
hv_terminal.update_bus_current_margins();
dcdc.control(); // control of DC/DC including MPPT algorithm
leds_set_charging(half_bridge_enabled());
@@ -123,11 +123,11 @@ void control_thread()
last_call = now;
// energy + soc calculation must be called exactly once per second
#if CONFIG_HAS_DCDC_CONVERTER
#if DT_COMPAT_DCDC
hv_terminal.energy_balance();
#endif
#if CONFIG_HAS_PWM_SWITCH
#if DT_COMPAT_PWM_SWITCH
pwm_switch.energy_balance();
#endif
@@ -137,7 +137,7 @@ void control_thread()
dev_stat.update_min_max_values();
charger.update_soc(&bat_conf);
#if CONFIG_HS_MOSFET_FAIL_SAFE_PROTECTION && CONFIG_HAS_DCDC_CONVERTER
#if CONFIG_HS_MOSFET_FAIL_SAFE_PROTECTION && DT_COMPAT_DCDC
if (dev_stat.has_error(ERR_DCDC_HS_MOSFET_SHORT)) {
dcdc.fuse_destruction();
}