diff Small_CPU/Src/baseCPU2.c @ 922:7c996354b8ac Evo_2_23

Moved UART6 into a separate unit: UART6 connects internal devices. As a first step the existing code sections have been moved into a new unit. As well the code of the external GNSS sensor has been copied into this unit as starting point for the further development. Later the internal part can be integrated into the common uart (code cleanup).
author Ideenmodellierer
date Sun, 03 Nov 2024 20:53:05 +0100
parents 0d6c4b40fae4
children effadaa3a1f7
line wrap: on
line diff
--- a/Small_CPU/Src/baseCPU2.c	Sun Nov 03 18:19:51 2024 +0100
+++ b/Small_CPU/Src/baseCPU2.c	Sun Nov 03 20:53:05 2024 +0100
@@ -143,6 +143,7 @@
 #include "tm_stm32f4_otp.h"
 #include "externalInterface.h"
 #include "uart.h"
+#include "uart_Internal.h"
 #include "GNSS.h"
 
 
@@ -235,7 +236,7 @@
 static void GPIO_Power_MainCPU_Init(void);
 static void GPIO_Power_MainCPU_ON(void);
 static void GPIO_Power_MainCPU_OFF(void);
-#ifdef ENABLE_GNSS
+#ifdef ENABLE_GPIO_V2
 static void GPIO_LED_RED_OFF(void);
 static void GPIO_LED_RED_ON(void);
 static void GPIO_LED_GREEN_OFF(void);
@@ -412,24 +413,24 @@
 
 			if (global.mode == MODE_BOOT) {
 				GPIO_Power_MainCPU_OFF();
-#ifdef ENABLE_GNSS
+#ifdef ENABLE_GPIO_V2
 				GPIO_LED_GREEN_ON();
 #endif
 				HAL_Delay(100); // for GPIO_Power_MainCPU_ON();
 				GPIO_Power_MainCPU_ON();
-#ifdef ENABLE_GNSS
+#ifdef ENABLE_GPIO_V2
 				GPIO_LED_GREEN_OFF();
 
 				GPIO_LED_RED_ON();
 				GPIO_VIBRATION_ON();
 #endif
 				HAL_Delay(100);
-#ifdef ENABLE_GNSS
+#ifdef ENABLE_GPIO_V2
 				GPIO_LED_RED_OFF();
 				GPIO_VIBRATION_OFF();
 #endif
 			}
-#ifdef ENABLE_GNSS
+#ifdef ENABLE_GPIO_V2
 			GPIO_LED_RED_OFF();
 			GPIO_LED_GREEN_OFF();
 			GPIO_VIBRATION_OFF();
@@ -440,7 +441,7 @@
 			SPI_Start_single_TxRx_with_Master(); /* be prepared for the first data exchange */
 			Scheduler_Request_sync_with_SPI(SPI_SYNC_METHOD_HARD);
 
-#ifdef ENABLE_GNSS
+#ifdef ENABLE_GPIO_V2
 			// GNSS tests
 			GNSS_IO_init();
 			GPIO_GPS_ON();
@@ -449,16 +450,6 @@
 			GNSS_Init(&GNSS_Handle, &huart6);
 #endif
 
-#if 0
-			HAL_Delay(1000);
-			GNSS_LoadConfig(&GNSS_Handle);
-			HAL_Delay(250);
-			GNSS_GetUniqID(&GNSS_Handle);
-			GNSS_ParseBuffer(&GNSS_Handle);
-			HAL_Delay(250);
-			GNSS_GetPVTData(&GNSS_Handle);
-			GNSS_ParseBuffer(&GNSS_Handle);
-#endif
 /*
  * Demo code from SimpleMethod
  * called 1/second
@@ -899,7 +890,7 @@
 	HAL_GPIO_WritePin( GPIOC, MAINCPU_CONTROL_PIN, GPIO_PIN_SET);
 }
 
-#ifdef ENABLE_GNSS
+#ifdef ENABLE_GPIO_V2
 static void GPIO_LED_GREEN_ON(void) {
 	HAL_GPIO_WritePin( GPIOA, LED_CONTROL_PIN_GREEN, GPIO_PIN_RESET);
 }
@@ -1045,7 +1036,7 @@
 	HAL_GPIO_Init( GPIOH, &GPIO_InitStruct);
 
 	GPIO_Power_MainCPU_OFF();
-#ifdef ENABLE_GNSS
+#ifdef ENABLE_GPIO_V2
 	GPIO_LED_GREEN_OFF();
 	GPIO_LED_RED_OFF();
 	GPIO_VIBRATION_OFF();