哪位大虾帮我看看为什么中断不能响应
#pragma config POSCMOD = XT, FNOSC = PRIPLL
#pragma config FPLLIDIV = DIV_2, FPLLMUL = MUL_18, FPLLODIV = DIV_1
#pragma config FPBDIV= DIV_2,FWDTEN = OFF,CP =OFF,BWP =OFF
#include <p32xxxx.h>
#include<plib.h>
#include <stdio.h>
#define delayms(x) \
{ \
int i; \
i = x*10; \
while((--i) != 0); \
}
static int count =0;
void __ISR(_CHANGE_NOTICE_VECTOR, ipl1) CNIntHandler( void )
{
int i =0;
if(!_RB2)
{//延时检测跳变前沿
do
{
delayms(5);
if(!_RB2)
i++;
else
i = 0;
}
while(i < 10);
while(!_RB2);
//延时检测跳变后沿
do
{
delayms(5);
if(_RB2)
i++;
else
i = 0;
}
while(i < 10);
count++;
}
mCNClearIntFlag();
}
int main(void)
{
//CNIF = 0;
TRISB = 1;
AD1PCFG = 0xffff;
CNENbits.CNEN4 =1;//连接的RB2引脚
CNCONbits.ON =1;
mCNSetIntPriority( 1);
INTEnableSystemSingleVectoredInt();
mCNClearIntFlag();
mCNIntEnable( 1);
while(1)
{
}
}
以上我是我的中断程序,为什么调试的时候就是停在while那里,按键按下时没反应,中断函数不能响应!
[解决办法]
多看看