diff Small_CPU/Src/baseCPU2.c @ 903:0f2e5a166d40 Evo_2_23

Disable GNSS operations using compile switch: GNSS IO operation caused the RTE to not switch into sleep mode in case of wrong HW version => Operations have been disabled by inactive ENABLE_GNSS compile switch
author Ideenmodellierer
date Thu, 03 Oct 2024 20:25:49 +0200
parents 6a7701f66b16
children 6902bb4b6b2e
line wrap: on
line diff
--- a/Small_CPU/Src/baseCPU2.c	Wed Oct 02 22:18:19 2024 +0200
+++ b/Small_CPU/Src/baseCPU2.c	Thu Oct 03 20:25:49 2024 +0200
@@ -235,6 +235,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
 static void GPIO_LED_RED_OFF(void);
 static void GPIO_LED_RED_ON(void);
 static void GPIO_LED_GREEN_OFF(void);
@@ -245,7 +246,7 @@
 static void GPIO_GPS_ON(void);
 static void GPIO_GPS_BCKP_OFF(void);
 static void GPIO_GPS_BCKP_ON(void);
-
+#endif
 #ifdef DEBUG_I2C_LINES
 void GPIO_test_I2C_lines(void);
 #endif
@@ -409,22 +410,28 @@
 
 			if (global.mode == MODE_BOOT) {
 				GPIO_Power_MainCPU_OFF();
-
+#ifdef ENABLE_GNSS
 				GPIO_LED_GREEN_ON();
+#endif
 				HAL_Delay(100); // for GPIO_Power_MainCPU_ON();
 				GPIO_Power_MainCPU_ON();
-
+#ifdef ENABLE_GNSS
 				GPIO_LED_GREEN_OFF();
 
 				GPIO_LED_RED_ON();
 				GPIO_VIBRATION_ON();
+#endif
 				HAL_Delay(100);
+#ifdef ENABLE_GNSS
 				GPIO_LED_RED_OFF();
 				GPIO_VIBRATION_OFF();
+#endif
 			}
+#ifdef ENABLE_GNSS
 			GPIO_LED_RED_OFF();
 			GPIO_LED_GREEN_OFF();
 			GPIO_VIBRATION_OFF();
+#endif
 			SPI_synchronize_with_Master();
 			MX_DMA_Init();
 			MX_SPI1_Init();
@@ -885,6 +892,7 @@
 	HAL_GPIO_WritePin( GPIOC, MAINCPU_CONTROL_PIN, GPIO_PIN_SET);
 }
 
+#ifdef ENABLE_GNSS
 static void GPIO_LED_GREEN_ON(void) {
 	HAL_GPIO_WritePin( GPIOA, LED_CONTROL_PIN_GREEN, GPIO_PIN_RESET);
 }
@@ -924,7 +932,7 @@
 static void GPIO_GPS_BCKP_OFF(void) {
 	HAL_GPIO_WritePin( GPIOB, GPS_BCKP_CONTROL_PIN, GPIO_PIN_RESET);
 }
-
+#endif
 
 /**
  * @brief  Configures EXTI Line0 (connected to PA0 + PA1 pin) in interrupt mode
@@ -1030,6 +1038,7 @@
 	HAL_GPIO_Init( GPIOH, &GPIO_InitStruct);
 
 	GPIO_Power_MainCPU_OFF();
+#ifdef ENABLE_GNSS
 	GPIO_LED_GREEN_OFF();
 	GPIO_LED_RED_OFF();
 	GPIO_VIBRATION_OFF();
@@ -1037,7 +1046,7 @@
 	GPIO_GPS_OFF();
 
 	MX_USART6_UART_DeInit();
-
+#endif
 #ifndef DEBUGMODE
 	__HAL_RCC_GPIOB_CLK_DISABLE();
 #endif