修复BUG

This commit is contained in:
HEYAHONG 2024-04-08 12:10:19 +08:00
parent 7fd9bf8eff
commit 74f079c56a
No known key found for this signature in database
GPG Key ID: 97E3E469FE2C920B

View File

@ -304,7 +304,10 @@ static void uart_isr(struct rt_serial_device *serial)
}
else if ((USART_GetITStatus(uart->config->Instance, USART_IT_TC) != RESET) && (USART_GetFlagStatus(uart->config->Instance, USART_FLAG_TC) != RESET))
{
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_TX_DONE);
if(serial->serial_tx != NULL && ((((rt_device_t)serial)->open_flag & RT_DEVICE_FLAG_INT_TX)) !=0 )
{
rt_hw_serial_isr(serial, RT_SERIAL_EVENT_TX_DONE);
}
USART_ClearITPendingBit(uart->config->Instance, USART_IT_TC);
USART_ClearFlag(uart->config->Instance, USART_FLAG_TC);
}