File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments