diff Small_CPU/Src/uart.c @ 861:ad96f99ebc78 Evo_2_23

Synchronize ADC and UART activities: depending on the cable configuration the UART sensor operation may have an impact to the ADC measurement (peaks). To avoid this the ADC measurements are now only started in case no UART communication is pending.
author Ideenmodellierer
date Tue, 07 May 2024 21:25:25 +0200
parents c3dd461ca3f9
children cf3967fe6924
line wrap: on
line diff
--- a/Small_CPU/Src/uart.c	Tue May 07 21:20:56 2024 +0200
+++ b/Small_CPU/Src/uart.c	Tue May 07 21:25:25 2024 +0200
@@ -260,6 +260,17 @@
 	}
 }
 
+uint8_t UART_isComActive(uint8_t sensorId)
+{
+	uint8_t active = 1;
 
+	uint8_t ComState = externalInterface_GetSensorState(sensorId + EXT_INTERFACE_MUX_OFFSET);
+
+	if((ComState == UART_COMMON_INIT) || (ComState == UART_COMMON_IDLE) || (ComState == UART_COMMON_ERROR))
+	{
+		active = 0;
+	}
+	return active;
+}
 
 /************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/