Skip to content

Commit

Permalink
Merge pull request #475 from houkhouk/fix/PTP_reset_value
Browse files Browse the repository at this point in the history
ensure that PTP is low after reset
  • Loading branch information
nicolas-rabault authored Feb 2, 2024
2 parents c227143 + 4ccd883 commit 4ed1943
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/projects/NUCLEO-G431KB/gate_serialcom/src/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

/* Includes ------------------------------------------------------------------*/
#include "gpio.h"
#include "robus_hal_config.h"

/* USER CODE BEGIN 0 */

Expand Down Expand Up @@ -57,6 +58,22 @@ void MX_GPIO_Init(void)
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct);

/*Configure GPIO pin : PtPin */
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(PTPA_PORT, &GPIO_InitStruct);

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 */
Expand Down

0 comments on commit 4ed1943

Please sign in to comment.