From 4ccd8830d3ee9ab8d927a46b25231392e709e4b6 Mon Sep 17 00:00:00 2001 From: Maxime COZZI Date: Fri, 2 Feb 2024 12:09:53 +0100 Subject: [PATCH] make fix genericusing hardware description macros --- .../NUCLEO-G431KB/gate_serialcom/src/gpio.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/projects/NUCLEO-G431KB/gate_serialcom/src/gpio.c b/examples/projects/NUCLEO-G431KB/gate_serialcom/src/gpio.c index 7879bf287..93245457b 100644 --- a/examples/projects/NUCLEO-G431KB/gate_serialcom/src/gpio.c +++ b/examples/projects/NUCLEO-G431KB/gate_serialcom/src/gpio.c @@ -19,6 +19,7 @@ /* Includes ------------------------------------------------------------------*/ #include "gpio.h" +#include "robus_hal_config.h" /* USER CODE BEGIN 0 */ @@ -59,14 +60,20 @@ void MX_GPIO_Init(void) HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5; + GPIO_InitStruct.Pin = PTPA_PIN; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_PULLDOWN; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + HAL_GPIO_Init(PTPA_PORT, &GPIO_InitStruct); - HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, RESET); - HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, RESET); + GPIO_InitStruct.Pin = PTPB_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_PULLDOWN; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(PTPB_PORT, &GPIO_InitStruct); + + HAL_GPIO_WritePin(PTPA_PORT, PTPA_PIN, RESET); + HAL_GPIO_WritePin(PTPB_PORT, PTPB_PIN, RESET); } /* USER CODE BEGIN 2 */