diff Small_CPU/Src/uartProtocol_Co2.c @ 916:4832981f9af8 Evo_2_23

External sensor UART: Switch to DMA TX transfers: The previous version used polling tx function to transfer data. Because of the short command length of the protocols supported this was no big issue. New protocolls (like GNSS) have longer command sequence which have an impact to the program flow. That's why the implementation has been changed to DMA transmission.
author Ideenmodellierer
date Mon, 28 Oct 2024 20:34:58 +0100
parents c3dd461ca3f9
children c0553dd70608
line wrap: on
line diff
--- a/Small_CPU/Src/uartProtocol_Co2.c	Sat Oct 19 20:10:56 2024 +0200
+++ b/Small_CPU/Src/uartProtocol_Co2.c	Mon Oct 28 20:34:58 2024 +0100
@@ -174,7 +174,7 @@
 			}
 		}
 	}
-	if((data == ' ') || (data == '\n'))	/* Abort data detection */
+	else if((data == ' ') || (data == '\n'))	/* Abort data detection */
 	{
 		if(rxState == CO2RX_DataComplete)
 		{
@@ -213,6 +213,13 @@
 			rxState = CO2RX_Ready;
 		}
 	}
+	else
+	{
+		if((rxState >= CO2RX_Data0) && (rxState <= CO2RX_Data4))
+		{
+			rxState = CO2RX_Ready; /* numerical data expected => abort */
+		}
+	}
 	externalInterface_SetSensorState(activeSensor + EXT_INTERFACE_MUX_OFFSET,localComState);
 }