DC/DC: Use high/low DcBus instead of PowerPort for control
This makes more sense because the DC/DC converter actually connects two DcBuses and does not need separate PowerPorts. Also makes the code look more clean as variable access like dcdc.hvs->bus->voltage is avoided. The DcBus pointers in the Dcdc are now called hvb and lvb for high- voltage side bus and low-voltage side bus.
This commit is contained in:
+3
-4
@@ -31,13 +31,12 @@ PowerPort lv_terminal(&lv_bus, true); // low voltage terminal (battery for typ
|
||||
#if DT_NODE_EXISTS(DT_PATH(dcdc))
|
||||
DcBus hv_bus;
|
||||
PowerPort hv_terminal(&hv_bus, true); // high voltage terminal (solar for typical MPPT)
|
||||
PowerPort dcdc_lv_port(&lv_bus); // internal low voltage side of DC/DC converter
|
||||
#if CONFIG_HV_TERMINAL_NANOGRID
|
||||
Dcdc dcdc(&hv_terminal, &dcdc_lv_port, DCDC_MODE_AUTO);
|
||||
Dcdc dcdc(&hv_bus, &lv_bus, DCDC_MODE_AUTO);
|
||||
#elif CONFIG_HV_TERMINAL_BATTERY
|
||||
Dcdc dcdc(&hv_terminal, &dcdc_lv_port, DCDC_MODE_BOOST);
|
||||
Dcdc dcdc(&hv_bus, &lv_bus, DCDC_MODE_BOOST);
|
||||
#else
|
||||
Dcdc dcdc(&hv_terminal, &dcdc_lv_port, DCDC_MODE_BUCK);
|
||||
Dcdc dcdc(&hv_bus, &lv_bus, DCDC_MODE_BUCK);
|
||||
#endif // CONFIG_HV_TERMINAL
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user