1
0
forked from me/IronOS

Update policy_engine_user.cpp

This commit is contained in:
Ben V. Brown
2021-04-05 11:56:46 +10:00
parent 93ed4c9887
commit 96cf92f9f7

View File

@@ -99,7 +99,7 @@ bool PolicyEngine::pdbs_dpm_evaluate_capability(const union pd_msg *capabilities
if (ideal_voltage_mv > (USB_PD_VMAX * 1000)) {
ideal_voltage_mv = (USB_PD_VMAX * 1000); // constrain to model max
}
if (ideal_voltage_mv > bestIndexVoltage) {
if (ideal_voltage_mv > bestIndexVoltage || bestIndex == 0xFF) {
bestIndex = i;
bestIndexVoltage = ideal_voltage_mv;
bestIndexCurrent = max_current;