diff Small_CPU/Src/externalInterface.c @ 738:30717de00f3a

Added data init function for external interface: If external sensors have been removed while OSTC was sleeping then (in case of digital sensor) an old value was displayed. By initializing the data structures after wakeup this is now avoided.
author Ideenmodellierer
date Thu, 02 Feb 2023 17:19:24 +0100
parents 2a801cfe23ab
children e23fe82cbf8c
line wrap: on
line diff
--- a/Small_CPU/Src/externalInterface.c	Mon Mar 06 16:03:00 2023 +0100
+++ b/Small_CPU/Src/externalInterface.c	Thu Feb 02 17:19:24 2023 +0100
@@ -83,12 +83,23 @@
 	}
 	global.deviceDataSendToMaster.hw_Info.checkADC = 1;
 
-/* init data values */
+	externalInterface_InitDatastruct();
+}
+
+void externalInterface_InitDatastruct(void)
+{
+	uint8_t index = 0;
+	/* init data values */
 	externalV33_On = 0;
 	externalCO2Value = 0;
 	externalCO2SignalStrength = 0;
 	externalCO2Status = 0;
 	externalAutoDetect = DETECTION_OFF;
+
+	for(index = 0; index < MAX_ADC_CHANNEL; index++)
+	{
+		externalChannel_mV[index] = 0.0;
+	}
 }