DC bus integrated into PowerPort class

Reason: Previous idea with storing the voltage only once and not in every port
doesn't work well for droop settings, e.g. the DC/DC output port doesn't know
the actual battery current, which should be used to calculate the droop caued
by wire resistance.
This commit is contained in:
Martin Jaeger
2019-10-22 18:23:19 +02:00
parent a89ac7ff4b
commit f879dc9c5d
22 changed files with 191 additions and 234 deletions
+3 -3
View File
@@ -100,18 +100,18 @@ void uext_process_1s()
oled.printf("n/a");
}
#ifndef CHARGER_TYPE_PWM
if (solar_terminal.bus->voltage > bat_terminal.bus->voltage)
if (solar_terminal.voltage > bat_terminal.voltage)
#endif
{
oled.setTextCursor(0, 26);
oled.printf("%4.1fV", solar_terminal.bus->voltage);
oled.printf("%4.1fV", solar_terminal.voltage);
}
// battery data
oled.setTextCursor(42, 18);
oled.printf("%5.1fW", (abs(bat_terminal.power) < 0.1) ? 0 : bat_terminal.power); // remove negative zeros
oled.setTextCursor(42, 26);
oled.printf("%5.1fV", bat_terminal.bus->voltage);
oled.printf("%5.1fV", bat_terminal.voltage);
// load data
oled.setTextCursor(90, 18);