1
0
forked from me/IronOS

Remove 0.5 ohm increase to resistance

Currently, IronOS increases the tip resistance by 0.5 ohms for the purposes of USB-PD negotiation.  On the Pinecil V2, this can cause issues with power supplies that only supply 60W, such as the Framework 60W supply.  At 6.2 ohms, 20V will produce 3.2A, but at 6.7 ohms it will produce 2.985 ohms.  This 0.5 ohms increase will cause the V2 to negotiate 20V, draw more than 3A, and trip the overcurrent protection, causing it to reboot.  Removing this increase will therefore cause it to fall back to the next highest voltage it can achieve.
This commit is contained in:
Daniel Allinson
2023-06-29 11:49:09 +01:00
parent 0a3dfb34ec
commit 59b17b24ed

View File

@@ -119,8 +119,7 @@ bool parseCapabilitiesArray(const uint8_t numCaps, uint8_t *bestIndex, uint16_t
*bestIndex = 0xFF; // Mark unselected
*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();
#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