在外部中断里systick系统中断无法触发中断
{
systick_over_cnt = ms;
while(systick_over_cnt != 0);//一直停在这里等待
}
/*这是定时器中断服务的调用函数*/
void delay_cnt_ctrl(void)
{
if(systick_over_cnt != 0x00)
systick_over_cnt--;
}
file:///C:\Users\xjg_1\AppData\Roaming\Tencent\Users\473398029\QQ\WinTemp\RichOle\$18F]2DMLYDMFB)FF9BXMAY.png
是优先级设置的不对导致的么?
/*这里是外部中断优先级的设置*/
void NVIC_Config(void)
{
/*==============????NVIC=====================*/
NVIC_InitTypeDef NVIC_InitStruct;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
//éè???D???′
NVIC_InitStruct.NVIC_IRQChannel = KEY1_EXTI_NVIC_IRQChANNEL;
//éè???÷ó??è??
NVIC_InitStruct.NVIC_IRQChannelPreemptionPriority = 1;
//éè??′?ó??è??
NVIC_InitStruct.NVIC_IRQChannelSubPriority = 1;
//ê1?ü?D??
NVIC_InitStruct.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStruct);
//éè???D???′
NVIC_InitStruct.NVIC_IRQChannel = KEY2_EXTI_NVIC_IRQChANNEL;
NVIC_Init(&NVIC_InitStruct);
}
滴答定时器的优先级是默认值