changeset 909:6902bb4b6b2e Evo_2_23

Define state of new GPIO out pins: Some new GPIO pins were initialized but not used. This may cause some random activations e.g. of the red debug LED. To avoid this the output levels are set to inactive levels (e.g. to LED_OFF)
author Ideenmodellierer
date Tue, 15 Oct 2024 19:07:19 +0200
parents eea7c7c041c1
children 7bd347bdaa81
files Small_CPU/Src/baseCPU2.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Small_CPU/Src/baseCPU2.c	Sun Oct 13 18:13:56 2024 +0200
+++ b/Small_CPU/Src/baseCPU2.c	Tue Oct 15 19:07:19 2024 +0200
@@ -820,18 +820,21 @@
 	GPIO_InitStructure.Pull = GPIO_PULLUP;
 	GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
 	HAL_GPIO_Init( GPIOA, &GPIO_InitStructure);
+	HAL_GPIO_WritePin( GPIOA, LED_CONTROL_PIN_RED, GPIO_PIN_SET);
 
 	GPIO_InitStructure.Pin = LED_CONTROL_PIN_GREEN;
 	GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
 	GPIO_InitStructure.Pull = GPIO_PULLUP;
 	GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
 	HAL_GPIO_Init( GPIOA, &GPIO_InitStructure);
+	HAL_GPIO_WritePin( GPIOA, LED_CONTROL_PIN_GREEN, GPIO_PIN_SET);
 
 	GPIO_InitStructure.Pin = VIBRATION_CONTROL_PIN;
 	GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
 	GPIO_InitStructure.Pull = GPIO_PULLDOWN;
 	GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
 	HAL_GPIO_Init( GPIOA, &GPIO_InitStructure);
+	HAL_GPIO_WritePin( GPIOA, VIBRATION_CONTROL_PIN, GPIO_PIN_RESET);
 
 	__GPIOB_CLK_ENABLE();
 	GPIO_InitStructure.Pin = GPS_POWER_CONTROL_PIN;
@@ -839,13 +842,14 @@
 	GPIO_InitStructure.Pull = GPIO_PULLUP;
 	GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
 	HAL_GPIO_Init( GPIOB, &GPIO_InitStructure);
+	HAL_GPIO_WritePin( GPIOB, GPS_POWER_CONTROL_PIN, GPIO_PIN_SET);
 
 	GPIO_InitStructure.Pin = GPS_BCKP_CONTROL_PIN;
 	GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
 	GPIO_InitStructure.Pull = GPIO_PULLDOWN;
 	GPIO_InitStructure.Speed = GPIO_SPEED_LOW;
 	HAL_GPIO_Init( GPIOB, &GPIO_InitStructure);
-
+	HAL_GPIO_WritePin( GPIOB, GPS_BCKP_CONTROL_PIN, GPIO_PIN_RESET);
 }
 
 void GPIO_new_DEBUG_Init(void) {