From b5fc1b589185b1a933184d2b4692328218f4af74 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" <5425387+Ralim@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:03:46 +1100 Subject: [PATCH] 4 ohm tip (#1868) * Add 4 ohm PTS200 tip for PinecilV2 * Add PTS200 4 ohm tip to TS101 * Update BSP.cpp --- source/Core/BSP/Miniware/BSP.cpp | 2 ++ source/Core/BSP/Pinecilv2/BSP.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/Core/BSP/Miniware/BSP.cpp b/source/Core/BSP/Miniware/BSP.cpp index 0ad8f4d4..d823263c 100644 --- a/source/Core/BSP/Miniware/BSP.cpp +++ b/source/Core/BSP/Miniware/BSP.cpp @@ -308,6 +308,8 @@ void FinishMeasureTipResistance() { return; } else if (reading < 200) { tipShorted = true; + } else if (reading < 520) { + newRes = 40; } else if (reading < 800) { newRes = 62; } else { diff --git a/source/Core/BSP/Pinecilv2/BSP.cpp b/source/Core/BSP/Pinecilv2/BSP.cpp index c511be2e..59314453 100644 --- a/source/Core/BSP/Pinecilv2/BSP.cpp +++ b/source/Core/BSP/Pinecilv2/BSP.cpp @@ -193,13 +193,14 @@ void FinishMeasureTipResistance() { ((tipResistanceReadings[1] - tipResistanceReadings[2]) + calculatedSkew) // jump 2 - skew ) // / 2; // Take average - // lastTipResistance = reading / 100; - // // As we are only detecting two resistances; we can split the difference for now + // As we are only detecting three resistances; we just bin to nearest uint8_t newRes = 0; if (reading > 8000) { - // return; // Change nothing as probably disconnected tip + // Let resistance be cleared to 0 } else if (reading < 500) { tipShorted = true; + } else if (reading < 2600) { + newRes = 40; } else if (reading < 4000) { newRes = 62; } else {