Differentiate between src and sink droop res again

Necessary for improved load disconnect switch behavior.
This commit is contained in:
Martin Jäger
2020-02-19 14:34:40 +01:00
parent 6af8e6d93d
commit 0c20545f88
6 changed files with 60 additions and 29 deletions
+3 -4
View File
@@ -179,10 +179,9 @@ void PwmSwitch::control()
off_timestamp = uptime();
print_info("PWM charger stop.\n");
}
else if (bus->voltage > (bus->sink_voltage_bound -
bus->droop_res * current) // voltage above target
|| current < neg_current_limit // port current limit exceeded
|| current < -PWM_CURRENT_MAX) // PCB current limit exceeded
else if (bus->voltage > bus->sink_droop_voltage() // bus voltage above target
|| current < neg_current_limit // port current limit exceeded
|| current < -PWM_CURRENT_MAX) // PCB current limit exceeded
{
// decrease power, as limits were reached