aboutsummaryrefslogtreecommitdiffhomepage
path: root/source/Core/Drivers/Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Core/Drivers/Utils.cpp')
-rw-r--r--source/Core/Drivers/Utils.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/Core/Drivers/Utils.cpp b/source/Core/Drivers/Utils.cpp
index b65922f3..b560fd3a 100644
--- a/source/Core/Drivers/Utils.cpp
+++ b/source/Core/Drivers/Utils.cpp
@@ -22,7 +22,10 @@ int32_t Utils::InterpolateLookupTable(const int32_t *lookupTable, const int noIt
int32_t Utils::LinearInterpolate(int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t x) { return y1 + (((((x - x1) * 1000) / (x2 - x1)) * (y2 - y1))) / 1000; }
uint16_t Utils::RequiredCurrentForTipAtVoltage(uint16_t voltageX10) {
- uint8_t tipResistancex10 = getTipResistanceX10() + 5;
+ uint8_t tipResistancex10 = getTipResistanceX10();
+ if (getSettingValue(SettingsOptions::USBPDMode) == 1) {
+ tipResistancex10 += 5;
+ }
#ifdef MODEL_HAS_DCDC
// If this device has step down DC/DC inductor to smooth out current spikes
// We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit