From f81257562d31234ac9355f1afcb46a61af4eacf5 Mon Sep 17 00:00:00 2001 From: alextrical <35117191+alextrical@users.noreply.github.com> Date: Fri, 30 Jun 2023 15:57:11 +0100 Subject: [PATCH] Tip short detection at boot If tip is shorted at boot, prevent the FW from running, with the intent to prevent the MOSFET from being damaged --- source/Core/BSP/Pinecilv2/BSP.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/Core/BSP/Pinecilv2/BSP.cpp b/source/Core/BSP/Pinecilv2/BSP.cpp index 28646a18..d49dd653 100644 --- a/source/Core/BSP/Pinecilv2/BSP.cpp +++ b/source/Core/BSP/Pinecilv2/BSP.cpp @@ -206,6 +206,11 @@ void FinishMeasureTipResistance() { uint8_t newRes = 0; if (reading > 8000) { // return; // Change nothing as probably disconnected tip + } else if (reading < 500) { + for (;;) /* Tip shorted, wait until reset */ + { + __NOP(); + } } else if (reading < 4000) { newRes = 62; } else {