Use LL for PWM switch driver to support STM32G4

This adds support for PWM solar input of MPPT 2420 HPX. Also adds new
PwmSwitch::test() function.
This commit is contained in:
Martin Jäger
2020-05-06 12:53:26 +02:00
parent 4011370646
commit 5e94d72117
5 changed files with 97 additions and 62 deletions
+6 -2
View File
@@ -96,6 +96,8 @@ void control_thread()
int wdt_channel = watchdog_register(200);
while (1) {
bool charging = false;
watchdog_feed(wdt_channel);
// convert ADC readings to meaningful measurement values
@@ -108,15 +110,17 @@ void control_thread()
#if DT_OUTPUTS_PWM_SWITCH_PRESENT
pwm_switch.control();
leds_set_charging(pwm_switch.active());
charging |= pwm_switch.active();
#endif
#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());
charging |= half_bridge_enabled();
#endif
leds_set_charging(charging);
#if DT_OUTPUTS_LOAD_PRESENT
load.control();
#endif