大家好,高手帮我改一下这个中断呗,让K_SET有长短按功能
void Time0() interrupt 1
{
char d,e;
TR0=0;
TH0=(65536-1000)/256;
TL0=(65536-1000)%256;
TR0=1;
d=P3;
//if((d&0xe0)|0xe0); //只对P1的高三位进行处理)
// KeyState=0;
if(K_SET==0)
{
KeyState=1;
e=0;
e++;
if(e==1000)
{
KeyState=2;
return;
}
}
if(K_INC==0)
KeyState=3;
if(K_DEC==0)
KeyState=4;
}
麻烦帮我弄一下,让K_SET健短按一下KeyState=1,长按=2.谢谢! |