diff Small_CPU/Src/scheduler.c @ 794:bb37d4f3e50e

Restructure UART based sensor handling: In the previous version every UART sensor instance had its own protocol handling instance (requests, timeout, errors). With the introduction of the multiplexer these functionalities had to be harmonized. E.g. only one errorhandling which is applied to all sensors. In the new structure the sensor communication is split into one function which takes care for the control needs of a sensor and one function which handles the incoming data. The functions behalf the same independend if the sensor are connected to multiplexer or directly to the OSTC. Second big change in the external sensor concepts is that the data processing is no longer focussed at the three existing ADC channels. Every external sensor (up to 3 ADC and 4 UART) sensor has its own instance. If the ADC slots are not in use then they may be used for visiualization of UART sensors by creating a mirror instance but this is no longer a must.
author Ideenmodellierer
date Mon, 31 Jul 2023 19:46:29 +0200
parents 19ab6f3ed52a
children 91d5ef16f1fd
line wrap: on
line diff
--- a/Small_CPU/Src/scheduler.c	Thu Jul 27 21:52:19 2023 +0200
+++ b/Small_CPU/Src/scheduler.c	Mon Jul 31 19:46:29 2023 +0200
@@ -516,21 +516,9 @@
 		lasttick = HAL_GetTick();
 		ticksdiff = time_elapsed_ms(Scheduler.tickstart,lasttick);
 
-#ifdef ENABLE_CO2_SUPPORT
-		if(externalInterface_GetUARTProtocol() & (EXT_INTERFACE_UART_CO2 >> 8))
+		if(externalInterface_GetUARTProtocol() != 0)
 		{
-			UART_HandleCO2Data();
-		}
-#endif
-#ifdef ENABLE_SENTINEL_MODE
-		if(externalInterface_GetUARTProtocol() & (EXT_INTERFACE_UART_SENTINEL >> 8))
-		{
-			UART_HandleSentinelData();
-		}
-#endif
-		if(externalInterface_GetUARTProtocol() & (EXT_INTERFACE_UART_O2 >> 8))
-		{
-			UART_HandleDigitalO2();
+			externalInterface_HandleUART();
 		}
 
 		if(ticksdiff >= Scheduler.counterSPIdata100msec * 100 + 10)
@@ -838,22 +826,9 @@
 				setButtonsNow = 0;
 		}
 
-#ifdef ENABLE_CO2_SUPPORT
-		if(externalInterface_GetUARTProtocol() & (EXT_INTERFACE_UART_CO2 >> 8))
+		if(externalInterface_GetUARTProtocol() != 0)
 		{
-			UART_HandleCO2Data();
-		}
-#endif
-#ifdef ENABLE_SENTINEL_MODE
-		if(externalInterface_GetUARTProtocol() & (EXT_INTERFACE_UART_SENTINEL >> 8))
-		{
-			UART_HandleSentinelData();
-		}
-#endif
-
-		if(externalInterface_GetUARTProtocol() & (EXT_INTERFACE_UART_O2 >> 8))
-		{
-			UART_HandleDigitalO2();
+			externalInterface_HandleUART();
 		}
 
 		/* Evaluate received data at 10 ms, 110 ms, 210 ms,... duration ~<1ms */