Expand USB-PD mode option (#1917)
* Use PDMode to decide if we do resistance pad * Rename PDVpdo to USBPDMode * Add options for PD Mode * OLED: Allow soft line-wrap x position * Add new translation option for menu settings values * Use new setting value for PD Mode * Update translations for new menu setting * Fixup! S60 * black python
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user