From e745298cf3076a289adbfe91f868d1918b3911d2 Mon Sep 17 00:00:00 2001
From: Carl Philipp Klemm <philipp@uvos.xyz>
Date: Tue, 7 May 2024 14:32:51 +0200
Subject: [PATCH] set setpoints to zero at startup to avoid overcurrent trip

---
 heater.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/heater.cpp b/heater.cpp
index 77319b0..b454688 100644
--- a/heater.cpp
+++ b/heater.cpp
@@ -42,6 +42,11 @@ deviceFailCb(deviceFailCbIn), heaterFailCb(heaterFailCbIn)
 					" reports its heater " + std::to_string(heater) + " is in a fault conditon: " +
 					coincellhell_string_for_fault(states[i].faultType));
 			}
+
+			ret = coincellhell_set_temperature(&devices[i].device, heater, 0);
+
+			if(ret != 0)
+				throw startup_failure("Unable to set temperature to coincellhell with serial " + std::to_string(serials[i]));
 		}
 	}
 }
-- 
GitLab