NVIC_PriorityGroupConfig(NVIC_PriorityGroup_3);
/* Enable the TIM2 Interrupt */ NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); /* Enable the TIM3 Interrupt */ NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1; NVIC_Init(&NVIC_InitStructure); /* Enable the EXTI9_5 Interrupt */ NVIC_InitStructure.NVIC_IRQChannel = EXTI9_5_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 2; NVIC_Init(&NVIC_InitStructure); /* Enable the ADC1 Interrupt */ NVIC_InitStructure.NVIC_IRQChannel = ADC_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 3; NVIC_Init(&NVIC_InitStructure); /* Enable the USART1 Interrupt */ NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 4; NVIC_Init(&NVIC_InitStructure); 刚开始对STM32学习使用,碰到一个问题:我在初始化时将以上各个中断都Enable了,为什么一直进入USART1中断,其他中断都进不了。而如果把USART1中断Disable了。其他中断都正常进入? |