From c55ecbff6cf4eaad86dbd686a84ed54b128d1196 Mon Sep 17 00:00:00 2001 From: discip <53649486+discip@users.noreply.github.com> Date: Thu, 24 Nov 2022 23:56:15 +0100 Subject: [PATCH] fixed CJC calibration rule Did not calibrate if *handle temp* was higher than *tip temp*. --- source/Core/Threads/GUIThread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Core/Threads/GUIThread.cpp b/source/Core/Threads/GUIThread.cpp index cb8ded01..bef78d14 100644 --- a/source/Core/Threads/GUIThread.cpp +++ b/source/Core/Threads/GUIThread.cpp @@ -98,7 +98,7 @@ void performCJCC() { // Calibrate Cold Junction Compensation directly at boot, before internal components get warm. OLED::refresh(); osDelay(50); - if (!isTipDisconnected() && (TipThermoModel::getTipInC() - getHandleTemperature(0) / 10) < 10) { + if (!isTipDisconnected() && abs( int(TipThermoModel::getTipInC() - getHandleTemperature(0) / 10)) < 10) { uint16_t setoffset = 0; // If the thermo-couple at the end of the tip, and the handle are at // equilibrium, then the output should be zero, as there is no temperature @@ -1231,4 +1231,4 @@ void startGUITask(void const *argument) { GUIDelay(); } } -} \ No newline at end of file +}