[size=11.818181991577148px]stm32程序中两个中断一个是串口中断另一个是红外触发中断
[size=11.818181991577148px] 串口中断函数
[size=11.818181991577148px] void NVIC_Configuration1(void)
[size=11.818181991577148px]{
[size=11.818181991577148px] NVIC_InitTypeDef NVIC_InitStructure;
[size=11.818181991577148px] /* Configure the NVIC Preemption Priority Bits */
[size=11.818181991577148px] NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
[size=11.818181991577148px]
[size=11.818181991577148px] /* Enable the USARTy Interrupt */
[size=11.818181991577148px] NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn;
[size=11.818181991577148px] NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
[size=11.818181991577148px] NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;
[size=11.818181991577148px] NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
[size=11.818181991577148px] NVIC_Init(&NVIC_InitStructure);
}
红外接收中断
static void NVIC_Configuration(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
/* Configure one bit for preemption priority */
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
/* ÅäÖÃP[A|B|C|D|E]11ΪÖжÏÔ´ */
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 5;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
红外线的触发中断优先级大于 串口的啊?怎么红外的触发不好使呢
PS:当串口配置
USART_ITConfig(USART3, USART_IT_RXNE, ENABLE);
USART_ITConfig(USART3, USART_IT_TXE, ENABLE);
这俩句取消之后,红外线的中断就可以这是什么原因呢, 有需要怎么设置呢,
请教下各位
|
|