| 
 
| stm32的usart,在复位后,SR寄存器中的TXE和TC标志位为1,我一使能usart就进入中断程序,后来我先把这两个标志清楚,再使能usart还是进入中断,发现使能后TC标志又为1,太郁闷了,这样的设计太垃圾了。 
 我都没有发送数据,为什么硬件自动把TC标志置位呢?不合乎逻辑。有什么好的解决方法?
 
 /* Configure the USARTx */
 USART_Init(USART1, &USART_InitStructure);
 USART_ClockInit(USART1, &USART_ClockInitStructure);
 USART_ClearITPendingBit(USART1,USART_IT_RXNE);
 USART_ClearITPendingBit(USART1,USART_IT_TC);
 
 /* Enable the USARTx */
 USART_Cmd(USART1, ENABLE);
 
 USART_ClearITPendingBit(USART1,USART_IT_RXNE);
 USART_ClearITPendingBit(USART1,USART_IT_TC);
 
 /* Enable the USART Receive interrupt: this interrupt is generated when the
 USART1 receive data register is not empty */
 USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);
 USART_ITConfig(USART1, USART_IT_TC, ENABLE);
 | 
 |