diff Small_CPU/Src/uart.c @ 988:d9290c76b840 GasConsumption

OSTC4/5 joined code: In the previous version code differences between OSTC4/5 were identified using the ENABLE_GPIO_V2 compiler switch. In the new version this is done using the display version as indicator which OSTC model is in used. Since this is detected by Firmware the information is forwarded from there to the RTE. This causes a little delay in the GPIO initialization but this applies only to the cold start of the RTE which should not happen very often.
author ideenmodellierer
date Sun, 06 Apr 2025 21:02:17 +0200 (3 weeks ago)
parents 0b81ac558e89
children c386ae6635e4
line wrap: on
line diff
--- a/Small_CPU/Src/uart.c	Sat Mar 29 14:56:08 2025 +0100
+++ b/Small_CPU/Src/uart.c	Sun Apr 06 21:02:17 2025 +0200
@@ -28,7 +28,7 @@
 #include "data_exchange.h"
 #include <string.h>	/* memset */
 
-#ifdef ENABLE_GPIO_V2
+#ifdef ENABLE_GNSS_INTERN
 extern UART_HandleTypeDef huart6;
 extern sUartComCtrl Uart6Ctrl;
 #endif
@@ -104,9 +104,11 @@
   Uart1Ctrl.pTxBuffer = txBuffer;
   Uart1Ctrl.txBufferQueLen = 0;
 
-#ifndef ENABLE_GPIO_V2
+#ifndef ENABLE_GNSS_INTERN
+#ifdef ENABLE_GNSS_EXTERN
   UART_SetGnssCtrl(&Uart1Ctrl);
 #endif
+#endif
 }
 
 
@@ -337,10 +339,13 @@
 	{
 		UART_HandleRxComplete(&Uart1Ctrl);
 	}
-#ifdef ENABLE_GPIO_V2
-	if(huart == &huart6)
+#ifdef ENABLE_GNSS_INTERN
+	if(GPIO_GetVersion() > 0)
 	{
-		UART_HandleRxComplete(&Uart6Ctrl);
+		if(huart == &huart6)
+		{
+			UART_HandleRxComplete(&Uart6Ctrl);
+		}
 	}
 #endif
 }
@@ -363,10 +368,13 @@
 	{
 		UART_HandleTxComplete(&Uart1Ctrl);
 	}
-#ifdef ENABLE_GPIO_V2
-	if(huart == &huart6)
+#ifdef ENABLE_GNSS_INTERN
+	if(GPIO_GetVersion() > 0)
 	{
-		UART_HandleTxComplete(&Uart6Ctrl);
+		if(huart == &huart6)
+		{
+			UART_HandleTxComplete(&Uart6Ctrl);
+		}
 	}
 #endif
 }
@@ -401,11 +409,13 @@
 
 	if(sensorType == SENSOR_GNSS)
 	{
-#ifdef ENABLE_GPIO_V2
+#ifdef ENABLE_GNSS_INTERN
 		pUartCtrl = &Uart6Ctrl;
 #else
+#ifdef ENABLE_GNSS_EXTERN
 		pUartCtrl = &Uart1Ctrl;
 #endif
+#endif
 	}
 	else
 	{
@@ -438,7 +448,7 @@
 				case SENSOR_CO2:	uartCo2_ProcessData(pUartCtrl->pRxBuffer[localRX]);
 					break;
 	#endif
-	#if defined ENABLE_GNSS_SUPPORT || defined ENABLE_GPIO_V2
+	#if defined ENABLE_GNSS_INTERN || defined ENABLE_GNSS_EXTERN
 					case SENSOR_GNSS:	uartGnss_ProcessData(pUartCtrl->pRxBuffer[localRX]);
 							break;
 	#endif