diff options
| author | 少年老王 <[email protected]> | 2022-11-30 20:36:17 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2022-12-06 10:37:35 +0800 |
| commit | 12ec87d64ec53f2395269713b8bf62bdb522e795 (patch) | |
| tree | 512fb089dfef30168439f9bb28803e97a67b2304 | |
| parent | 575fe18ea0f4a7ff5d9ca6642ac623fd6e47c9da (diff) | |
修改串口V2的putc顺序
1.顺序修改回V1,保证每次都是当前数据发送完才跳出
| -rw-r--r-- | bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c b/bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c index 90b4d928c5..49fb0990a1 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_usart_v2.c @@ -302,9 +302,9 @@ static int stm32_putc(struct rt_serial_device *serial, char c) RT_ASSERT(serial != RT_NULL); uart = rt_container_of(serial, struct stm32_uart, serial); - while (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_TC) == RESET); UART_INSTANCE_CLEAR_FUNCTION(&(uart->handle), UART_FLAG_TC); UART_SET_TDR(&uart->handle, c); + while (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_TC) == RESET); return 1; } |
