先看看这个跑飞的代码:
interrupt void T1PINT_ISR(void) // EV-A
{
extern int increase;
extern Uint32 intcount;
intcount++;
KickDog();
if(intcount>=1000) //禁止看门狗时,程序会跑飞,但当intcount>=100时,不会。开启看门狗,intcount>=任何值 都不会跑飞。
{
intcount = 0;
if(increase==1)
{
EvaRegs.CMPR1 = (EvaRegs.CMPR1-938);
if(EvaRegs.CMPR1<=0x0753)
{
EvaRegs.CMPR1 = 0x0753;
increase = 0;
}
}
if(increase==0)
{
EvaRegs.CMPR1 = (EvaRegs.CMPR1+938);
if(EvaRegs.CMPR1>=0x41EB)
{
EvaRegs.CMPR1 = 0x41EB;
increase = 1;
}
}
}
PieCtrl.PIEACK.all = PIEACK_GROUP2;
EvaRegs.EVAIFRA.bit.T1PINT = 1;
EINT;
}
它跑飞不是乱跑,而总是来到这里:
interrupt void CMP1INT_ISR(void) // EV-A
{
asm (" ESTOP0");
for(;;);
}
我很想知道程序跑飞的原因有哪些??
|