|
写了个实验小程序,可是中断后不能返回,那位大佬帮看一下问题出现在那里!!!谢...............
#include
unsigned char Run[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
unsigned char Flash[] = {0x00, 0xFF, 0X00, 0xFF, 0x00, 0xFF, 0X00, 0xFF};
void wait10ms(unsigned char i)
{
TR0=1;
while(i!=0)
{
TH0=-(10000/256);
TL0=-(10000%256);
while(TF0!=1);
TF0=0;
i--;
}
TR0=0;
}
void LED_Run(unsigned char *str)
{
unsigned char i;
for(i=0; i<8; i++)
{
P1 = str;
wait10ms(200);
}
}
void EXT0_INT(void)
{
EA=1;
PX0=1;
IT0=0;
EX0=1;
}
void EXT0_INT_SRV()interrupt 0
{
unsigned char i;
for(i=0; i<8; i++)
{
P1=Flash;
wait10ms(400);
}
}
void main(void)
{
EXT0_INT();
while(1)
{
LED_Run(&Run[0]);
}
}
|
|