diff options
| author | hathach <[email protected]> | 2024-01-11 23:56:04 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-01-11 23:56:04 +0700 |
| commit | ab7538d93a9d2a2289d0710f28b4a26df867eaee (patch) | |
| tree | 3d8f7c4af44789d77f486bcb1489af658e1a9b1e | |
| parent | 149b50a2fafd9320bc84a03c8197fbd58c59318c (diff) | |
fix build with f1 without uart
| -rw-r--r-- | hw/bsp/stm32f1/family.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/bsp/stm32f1/family.c b/hw/bsp/stm32f1/family.c index e79f9cd78..0c1b362ab 100644 --- a/hw/bsp/stm32f1/family.c +++ b/hw/bsp/stm32f1/family.c @@ -57,9 +57,6 @@ void board_init(void) { __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); - // Enable UART Clock - UART_CLK_EN(); - #if CFG_TUSB_OS == OPT_OS_NONE // 1ms tick timer SysTick_Config(SystemCoreClock / 1000); @@ -86,7 +83,10 @@ void board_init(void) { GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct); +#ifdef UART_DEV // UART + UART_CLK_EN(); + GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; @@ -105,6 +105,7 @@ void board_init(void) { .Init.OverSampling = UART_OVERSAMPLING_16 }; HAL_UART_Init(&UartHandle); +#endif // USB Pins // Configure USB DM and DP pins. |
