aboutsummaryrefslogtreecommitdiffhomepage
path: root/source/Core/Drivers
diff options
context:
space:
mode:
authorSamuel Hedrick <[email protected]>2023-02-19 14:13:50 -0600
committerSamuel Hedrick <[email protected]>2023-02-19 14:13:50 -0600
commit9892dd0423b20e953c57e2cb10eef618ab98b500 (patch)
treef3af408d6a5191037167b7af5fbc80686ef60b6c /source/Core/Drivers
parent5265d7b1ac27a0ef00c164e89524bb4eb90a7d57 (diff)
downloadIronOS-9892dd0423b20e953c57e2cb10eef618ab98b500.tar.gz
IronOS-9892dd0423b20e953c57e2cb10eef618ab98b500.zip
Added VPDO option for disabling PPS/EPR PDOs.
Diffstat (limited to 'source/Core/Drivers')
-rw-r--r--source/Core/Drivers/USBPD.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/Core/Drivers/USBPD.cpp b/source/Core/Drivers/USBPD.cpp
index 29524a0d..ca5a72ee 100644
--- a/source/Core/Drivers/USBPD.cpp
+++ b/source/Core/Drivers/USBPD.cpp
@@ -152,7 +152,7 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
}
}
}
- } else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (((lastCapabilities[i] & PD_APDO_TYPE) == PD_APDO_TYPE_PPS))) {
+ } else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (((lastCapabilities[i] & PD_APDO_TYPE) == PD_APDO_TYPE_PPS)) && getSettingValue(SettingsOptions::PDVpdoEnabled)) {
// If this is a PPS slot, calculate the max voltage in the PPS range that can we be used and maintain
uint16_t max_voltage = PD_PAV2MV(PD_APDO_PPS_MAX_VOLTAGE_GET(lastCapabilities[i]));
// uint16_t min_voltage = PD_PAV2MV(PD_APDO_PPS_MIN_VOLTAGE_GET(lastCapabilities[i]));
@@ -179,7 +179,7 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
}
}
#ifdef POW_EPR
- else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (((lastCapabilities[i] & PD_APDO_TYPE) == PD_APDO_TYPE_AVS))) {
+ else if ((lastCapabilities[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (((lastCapabilities[i] & PD_APDO_TYPE) == PD_APDO_TYPE_AVS)) && getSettingValue(SettingsOptions::PDVpdoEnabled)) {
uint16_t max_voltage = PD_PAV2MV(PD_APDO_AVS_MAX_VOLTAGE_GET(lastCapabilities[i]));
uint8_t max_wattage = PD_APDO_AVS_MAX_POWER_GET(lastCapabilities[i]);
@@ -372,4 +372,4 @@ void pdbs_dpm_get_sink_capability(pd_msg *cap, const bool isPD3) {
// cap->hdr = hdr_template | PD_MSGTYPE_SINK_CAPABILITIES | PD_NUMOBJ(numobj);
}
-#endif \ No newline at end of file
+#endif