Skip to content

Commit 073a7a5

Browse files
committed
revert the change in the f1 family.c since it break compile with other f1 that does not use UART.
1 parent 2f2d2bc commit 073a7a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hw/bsp/stm32f1/family.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ void board_init(void) {
5757
__HAL_RCC_GPIOC_CLK_ENABLE();
5858
__HAL_RCC_GPIOD_CLK_ENABLE();
5959

60-
// Enable UART Clock
61-
UART_CLK_EN();
62-
6360
#if CFG_TUSB_OS == OPT_OS_NONE
6461
// 1ms tick timer
6562
SysTick_Config(SystemCoreClock / 1000);
@@ -86,7 +83,10 @@ void board_init(void) {
8683
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
8784
HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
8885

86+
#ifdef UART_DEV
8987
// UART
88+
UART_CLK_EN();
89+
9090
GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
9191
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
9292
GPIO_InitStruct.Pull = GPIO_PULLUP;
@@ -105,6 +105,7 @@ void board_init(void) {
105105
.Init.OverSampling = UART_OVERSAMPLING_16
106106
};
107107
HAL_UART_Init(&UartHandle);
108+
#endif
108109

109110
// USB Pins
110111
// Configure USB DM and DP pins.

0 commit comments

Comments
 (0)