新手上路
- 积分
- 25
- 金钱
- 25
- 注册时间
- 2020-8-12
- 在线时间
- 4 小时
|
楼主 |
发表于 2020-9-27 11:46:39
|
显示全部楼层
void USART1_IRQHandler(void)
{
BaseType_t pxHigherPriorityTaskWoken;
u8 res;
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
{
//printf("1\r\n"); 加上printf就可以正常运行
RxBuffer_1[RxCounter_1++] = USART_ReceiveData(USART1);
while(USART_GetFlagStatus(USART1,USART_FLAG_TC) != SET);
}
if(USART_GetITStatus(USART1, USART_IT_IDLE) != RESET)
{
uart1_getok = 1;
}
if((Uart1_QueueISR != NULL))
{
xQueueSendFromISR(Uart1_QueueISR,RxBuffer_1,&pxHigherPriorityTaskWoken);
memset(RxBuffer_1,0,100);
portYIELD_FROM_ISR(pxHigherPriorityTaskWoken);
}
USART_ClearFlag(USART1,USART_FLAG_TC);
} |
|