From 96cf92f9f761aba5b8fd2dea5161d714481a04ff Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Mon, 5 Apr 2021 11:56:46 +1000 Subject: [PATCH] Update policy_engine_user.cpp --- source/Core/Drivers/FUSB302/policy_engine_user.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Core/Drivers/FUSB302/policy_engine_user.cpp b/source/Core/Drivers/FUSB302/policy_engine_user.cpp index 397d4791..5bbe116e 100644 --- a/source/Core/Drivers/FUSB302/policy_engine_user.cpp +++ b/source/Core/Drivers/FUSB302/policy_engine_user.cpp @@ -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;