From 762c1be8bbbb34f91ee154000a44ee3fae50a603 Mon Sep 17 00:00:00 2001 From: Hao Zhu Date: Sat, 8 Dec 2018 23:07:58 +0800 Subject: [PATCH] =?UTF-8?q?[bsp/stm32f7-disco]=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=B2=E5=8F=A3=E9=A9=B1=E5=8A=A8=E7=BC=96=E8=AF=91=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit __HAL_UART_CLEAR_FLAG在stm32f7xx_hal_uart.h中不存在,编译会报错 --- bsp/stm32f7-disco/drivers/drv_usart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bsp/stm32f7-disco/drivers/drv_usart.c b/bsp/stm32f7-disco/drivers/drv_usart.c index 2c15fafc29..f64f89e378 100644 --- a/bsp/stm32f7-disco/drivers/drv_usart.c +++ b/bsp/stm32f7-disco/drivers/drv_usart.c @@ -106,8 +106,9 @@ static int drv_putc(struct rt_serial_device *serial, char c) struct drv_uart *uart; RT_ASSERT(serial != RT_NULL); uart = (struct drv_uart *)serial->parent.user_data; - __HAL_UART_CLEAR_FLAG(&(uart->UartHandle), UART_FLAG_TC); + __HAL_UART_CLEAR_IT(&(uart->UartHandle), UART_CLEAR_TCF); uart->UartHandle.Instance->TDR = c; + while (__HAL_UART_GET_FLAG(&(uart->UartHandle), UART_FLAG_TC) == RESET); return 1; }