void intt0(void) interrupt 0
{
EX0=0;
keyvol=0;
if(remotein==0)
{
delay1ms(1);
if(remotein==0)
{
k=0;
while(1)
{
while(remotein==0)
{
keyvol++;
k=0;
delay1ms(1);
}
while(remotein==1)
{
delay1ms(1);
k++;
if(k>2)
{
goto loop1;
}
}
}
loop1:
{
switch(keyvol)
{
delay(10);
case 1:{P00=~P00;break;}
case 2:{P01=~P01;break;}
case 3:{P02=~P02;break;}
case 4:{P03=~P03;break;}
case 5:{P04=~P04;break;}
case 6:{P05=~P05;break;}
case 7:{P06=~P06;break;}
case 8:{P07=~P07;break;}
case 9:{P20=~P20;break;}
case 10:{P21=~P21;break;}
case 11:{P22=~P22;break;}
case 12:{P23=~P23;break;}
case 13:{P24=~P24;break;}
case 14:{P25=~P25;break;}
case 15:{P26=~P26;break;}
default:break;
}
}
}
}
EX0=1;
} |