3.清中断的方式感觉奇怪,使用函数USART_ClearITPendingBit( USART1, USART_IT_IDLE )清除不了中断的.我用的是3.5的库,查看函数说明,里面的@param参数并没有IDLE,后面的@note中,这样说:
"PE(Parity error),FE(Framing error),NE(Noise error),ORE(OverRun error) and IDLE(Idle line detected) pending bits are cleared by software sequence: a read operation to USART_SR register (USART_GetITStatus()) followed by a read operation to USART_DR register (USART_ReceiveData())."
我是通过语句"USART1->DR;"来清除IDLE中断的.