usart_transmit_config(usart_periph, USART_TRANSMIT_DISABLE);
void usart_transmit_config(uint32_t usart_periph, uint32_t txconfig)
{
USART_CTL0(usart_periph) &= ~USART_CTL0_TEN;
/* configure transfer mode */
USART_CTL0(usart_periph) |= txconfig;
}
调试发现USART_CTL0(usart_periph) &= ~USART_CTL0_TEN;执行完这条之后,TC就置1。
解决:
在usart_transmit_config()之后增加
usart_interrupt_flag_clear(usart_periph,USART_INT_FLAG_TC);
————————————————
版权声明:本文为CSDN博主「lljss2020」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/lljss1980/article/details/149663219
|
|