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:
@@ -135,7 +135,10 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
|
||||
*bestVoltage = 5000; // Default 5V
|
||||
|
||||
// Fudge of 0.5 ohms to round up a little to account for us always having off periods in PWM
|
||||
uint8_t tipResistance = getTipResistanceX10() + 5;
|
||||
uint8_t tipResistance = getTipResistanceX10();
|
||||
if (getSettingValue(SettingsOptions::USBPDMode) == 1) {
|
||||
tipResistance += 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
|
||||
@@ -167,7 +170,7 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && getSettingValue(SettingsOptions::PDVpdo)) {
|
||||
} else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && getSettingValue(SettingsOptions::USBPDMode)) {
|
||||
bool sourceIsEPRCapable = lastCapabilities[0] & PD_PDO_SRC_FIXED_EPR_CAPABLE;
|
||||
bool isPPS = false;
|
||||
bool isAVS = false;
|
||||
|
||||
Reference in New Issue
Block a user