金牌会员
 
- 积分
- 1163
- 金钱
- 1163
- 注册时间
- 2019-10-22
- 在线时间
- 226 小时
|

楼主 |
发表于 2023-7-24 16:46:16
|
显示全部楼层
我仿真了下,应该是卡在串口中断函数里边了,他就是一直在串口中断函数里面循环,但是
不会卡住,是因为我没清除标志位吗?
//中断控制函数void USART1_IRQHandler(void)
{
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) //接收中断触发
{
if(Enable_rx_timeout_flag == 0)
{
Enable_rx_timeout_flag = 1;
Rx_timeout_count = 0;
TIM_Cmd(TIM2,ENABLE);
}
Rx_timeout_count = 0;
}
if(USART_GetITStatus(USART1,USART_IT_TXE) != RESET) //发送中断触发
{
Send_Data_();
}
}
在数据发送完成后我用的 USART_ITConfig(USART1,USART_IT_TXE,DISABLE); //关闭发送中断
还用清除什么标志位吗
|
|