diff Small_CPU/Src/uart.c @ 1065:1f2067cad41b Icon_Integration

Mixed sensor operation improvment: A peak detector has been added to the adc measurement to avoid interferance while UART sensor are taking measurement while adc is active. The previous approach to shift adc into time windows where no UART were active had to be replaced because for the CO2 sensor is continously taking samples without providing a sync signal. In addition the UART MUX switching behavior has been improved (potential rx data received from previous sensor is discarded during channel switch etc.)
author Ideenmodellierer
date Mon, 16 Feb 2026 21:27:26 +0100
parents c386ae6635e4
children
line wrap: on
line diff
--- a/Small_CPU/Src/uart.c	Mon Feb 16 21:11:59 2026 +0100
+++ b/Small_CPU/Src/uart.c	Mon Feb 16 21:27:26 2026 +0100
@@ -440,25 +440,28 @@
 		while((!UART_isEndIndication(pUartCtrl, localRX)) || (moreData))
 		{
 			moreData = 0;
-			switch (sensorType)
+			if(flush == 0)
 			{
-				case SENSOR_MUX:
-				case SENSOR_DIGO2:	uartO2_ProcessData(pUartCtrl->pRxBuffer[localRX]);
-					break;
-	#ifdef ENABLE_CO2_SUPPORT
-				case SENSOR_CO2:	uartCo2_ProcessData(pUartCtrl->pRxBuffer[localRX]);
-					break;
-	#endif
-	#if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN
-					case SENSOR_GNSS:	uartGnss_ProcessData(pUartCtrl->pRxBuffer[localRX]);
-							break;
-	#endif
-	#ifdef ENABLE_SENTINEL_MODE
-				case SENSOR_SENTINEL:	uartSentinel_ProcessData(pUartCtrl->pRxBuffer[localRX]);
-					break;
-	#endif
-				default:
-					break;
+				switch (sensorType)
+				{
+					case SENSOR_MUX:
+					case SENSOR_DIGO2:	uartO2_ProcessData(pUartCtrl->pRxBuffer[localRX]);
+						break;
+#ifdef ENABLE_CO2_SUPPORT
+					case SENSOR_CO2:	uartCo2_ProcessData(pUartCtrl->pRxBuffer[localRX]);
+						break;
+#endif
+#if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN
+						case SENSOR_GNSS:	uartGnss_ProcessData(pUartCtrl->pRxBuffer[localRX]);
+								break;
+#endif
+#ifdef ENABLE_SENTINEL_MODE
+					case SENSOR_SENTINEL:	uartSentinel_ProcessData(pUartCtrl->pRxBuffer[localRX]);
+						break;
+#endif
+					default:
+						break;
+				}
 			}
 			if(localRX % 2)
 			{