mirror of
https://github.com/Ralim/IronOS.git
synced 2025-07-23 20:30:38 +02:00
Working Re-Neg
This commit is contained in:
@@ -135,6 +135,10 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
|
|||||||
*bestIndex = 0xFF; // Mark unselected
|
*bestIndex = 0xFF; // Mark unselected
|
||||||
*bestVoltage = 5000; // Default 5V
|
*bestVoltage = 5000; // Default 5V
|
||||||
|
|
||||||
|
if (tipMeasurementDone() != 1) {
|
||||||
|
// Tip measurement not done, so we cannot select anything other than 5V
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Fudge of 0.5 ohms to round up a little to account for us always having off periods in PWM
|
// Fudge of 0.5 ohms to round up a little to account for us always having off periods in PWM
|
||||||
uint8_t tipResistance = getTipResistanceX10();
|
uint8_t tipResistance = getTipResistanceX10();
|
||||||
if (getSettingValue(SettingsOptions::USBPDMode) == usbpdMode_t::DEFAULT) {
|
if (getSettingValue(SettingsOptions::USBPDMode) == usbpdMode_t::DEFAULT) {
|
||||||
|
Submodule source/Core/Drivers/usb-pd updated: 609dda7d16...905370a4b7
@@ -22,7 +22,7 @@
|
|||||||
// Small worker thread to handle power (PD + QC) related steps
|
// Small worker thread to handle power (PD + QC) related steps
|
||||||
|
|
||||||
void startPOWTask(void const *argument __unused) {
|
void startPOWTask(void const *argument __unused) {
|
||||||
bool haveNegotiatedHigherPower = false;
|
bool haveDoneSecondNegotiation = false;
|
||||||
// Init any other misc sensors
|
// Init any other misc sensors
|
||||||
postRToSInit();
|
postRToSInit();
|
||||||
// You have to run this once we are willing to answer PD messages
|
// You have to run this once we are willing to answer PD messages
|
||||||
@@ -56,8 +56,11 @@ void startPOWTask(void const *argument __unused) {
|
|||||||
USBPowerDelivery::PPSTimerCallback();
|
USBPowerDelivery::PPSTimerCallback();
|
||||||
USBPowerDelivery::step();
|
USBPowerDelivery::step();
|
||||||
// Once tip measurement is done, and we have done the basic negotiation, we want to do the higher voltage negotiation steps
|
// Once tip measurement is done, and we have done the basic negotiation, we want to do the higher voltage negotiation steps
|
||||||
if (tipMeasurementDone() == 1 && !haveNegotiatedHigherPower) {
|
if (tipMeasurementDone() == 1 && !haveDoneSecondNegotiation) {
|
||||||
USBPowerDelivery::reNegotiate();
|
if (USBPowerDelivery::negotiationComplete()) {
|
||||||
|
USBPowerDelivery::reNegotiate();
|
||||||
|
haveDoneSecondNegotiation = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
(void)res;
|
(void)res;
|
||||||
@@ -66,8 +69,9 @@ void startPOWTask(void const *argument __unused) {
|
|||||||
hub238_check_negotiation();
|
hub238_check_negotiation();
|
||||||
#endif
|
#endif
|
||||||
#if POW_PD_EXT == 2
|
#if POW_PD_EXT == 2
|
||||||
if (tipMeasurementDone() == 1) {
|
if (tipMeasurementDone() == 1 && !haveDoneSecondNegotiation) {
|
||||||
FS2711::negotiate();
|
FS2711::negotiate();
|
||||||
|
haveDoneSecondNegotiation = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
power_check();
|
power_check();
|
||||||
|
Reference in New Issue
Block a user