Make adc range scalable

This commit is contained in:
Ben V. Brown
2022-05-24 23:31:45 +10:00
parent 7c6534a339
commit 9fd1d366b9
6 changed files with 21 additions and 19 deletions

View File

@@ -234,11 +234,12 @@ uint8_t getTipResitanceX10() {
return lastTipResistance;
}
void startMeasureTipResistance() {
if (isTipDisconnected()) {
return;
}
if (lastTipReadinguV) {
return;
}
// We want to calculate lastTipResistance
// If tip is connected, and the tip is cold and the tip is not being heated
// We can use the GPIO to inject a small current into the tip and measure this
@@ -277,10 +278,5 @@ void FinishMeasureTipResistance() {
} else {
newRes = 80;
}
if (lastTipResistance != newRes) {
#ifdef POW_PD
USBPowerDelivery::triggerRenegotiation();
#endif
}
lastTipResistance = newRes;
}