From 40f757b7d1e1625dd2f0c80e9f3e433cc37a7d5bcba47e49efb464279154bd9b Mon Sep 17 00:00:00 2001 From: localhorst Date: Sat, 10 Jan 2026 11:54:18 +0100 Subject: [PATCH] uUnchangedCounter reset logic flaw --- main/safety.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main/safety.c b/main/safety.c index 94c0d04..f592a86 100644 --- a/main/safety.c +++ b/main/safety.c @@ -105,6 +105,7 @@ void checkSensorSanity(void) } else { + sanityChecks[i].uUnchangedCounter = 0U; sanityChecks[i].fSensorTemperatureLast = sCurrentMeasurement.fCurrentValue; if (sCurrentMeasurement.fCurrentValue > sanityChecks[i].sSensorLimit.max) @@ -121,12 +122,10 @@ void checkSensorSanity(void) } else { - sanityChecks[i].uUnchangedCounter = 0U; sanityChecks[i].state = SENSOR_NO_ERROR; } } } - // printf(" state: %u\n", sanityChecks[i].state); } }