stm32: fix conditional compilation error when not using uart
This commit is contained in:
@@ -43,7 +43,9 @@ void USB_UCPD1_2_IRQHandler(void) {
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO TYPEDEF CONSTANT ENUM
|
||||
//--------------------------------------------------------------------+
|
||||
#ifdef UART_DEV
|
||||
UART_HandleTypeDef UartHandle;
|
||||
#endif
|
||||
|
||||
void board_init(void) {
|
||||
HAL_Init(); // required for HAL_RCC_Osc TODO check with freeRTOS
|
||||
@@ -59,8 +61,6 @@ void board_init(void) {
|
||||
__HAL_RCC_SYSCFG_CLK_ENABLE();
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
|
||||
UART_CLK_EN();
|
||||
|
||||
#if CFG_TUSB_OS == OPT_OS_NONE
|
||||
// 1ms tick timer
|
||||
SysTick_Config(SystemCoreClock / 1000);
|
||||
@@ -91,6 +91,8 @@ void board_init(void) {
|
||||
HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct);
|
||||
|
||||
#ifdef UART_DEV
|
||||
UART_CLK_EN();
|
||||
|
||||
// UART
|
||||
GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
@@ -167,7 +169,6 @@ int board_uart_write(void const *buf, int len) {
|
||||
#else
|
||||
(void) buf;
|
||||
(void) len;
|
||||
(void) UartHandle;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user