[bsp][stm32][rsoc]串口超时判断逻辑有问题

[bsp][stm32]fix uart bug
This commit is contained in:
CYFS 2024-10-20 00:24:42 +08:00 committed by GitHub
parent 4c206caf8b
commit 76adf376db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -357,7 +357,7 @@ static int stm32_putc(struct rt_serial_device *serial, char c)
#else
uart->handle.Instance->DR = c;
#endif
while (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_TC) == RESET && block_timeout--);
while (__HAL_UART_GET_FLAG(&(uart->handle), UART_FLAG_TC) == RESET && --block_timeout);
return (block_timeout != 0) ? 1 : -1;
}