Skip to content

Commit 4ccd883

Browse files
houkhouknicolas-rabault
authored andcommitted
make fix genericusing hardware description macros
1 parent fb10344 commit 4ccd883

File tree

1 file changed

+11
-4
lines changed
  • examples/projects/NUCLEO-G431KB/gate_serialcom/src

1 file changed

+11
-4
lines changed

examples/projects/NUCLEO-G431KB/gate_serialcom/src/gpio.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
/* Includes ------------------------------------------------------------------*/
2121
#include "gpio.h"
22+
#include "robus_hal_config.h"
2223

2324
/* USER CODE BEGIN 0 */
2425

@@ -59,14 +60,20 @@ void MX_GPIO_Init(void)
5960
HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct);
6061

6162
/*Configure GPIO pin : PtPin */
62-
GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5;
63+
GPIO_InitStruct.Pin = PTPA_PIN;
6364
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
6465
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
6566
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
66-
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
67+
HAL_GPIO_Init(PTPA_PORT, &GPIO_InitStruct);
6768

68-
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_4, RESET);
69-
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, RESET);
69+
GPIO_InitStruct.Pin = PTPB_PIN;
70+
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
71+
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
72+
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
73+
HAL_GPIO_Init(PTPB_PORT, &GPIO_InitStruct);
74+
75+
HAL_GPIO_WritePin(PTPA_PORT, PTPA_PIN, RESET);
76+
HAL_GPIO_WritePin(PTPB_PORT, PTPB_PIN, RESET);
7077
}
7178

7279
/* USER CODE BEGIN 2 */

0 commit comments

Comments
 (0)