case 0xe7:
key=12;
break;
case 0xd7:
key=13;
break;
case 0xb7:
key=14;
break;
case 0x77:
key=15;
break;
}
while(temp!=0xf0)
{
temp=P3;
temp=temp&0xf0;
}
}
}
}
void setl()
{
keyscan();
if(keyval=keyset)
{
if(mode==set&&ledsetbit<=5)
{
ledsetbit++;
}
if(mode==set&&ledsetbit>5)
{
mode=run;
ledsetbit=0;
}
if(keyval==keyplu&&mode==set)
{
switch(ledsetbit)
{
case 0:if(s<59)s++;break;
case 1:if(s<50)s+=10;break;
case 2:if(m<59)m++;break;
case 3:if(m<50)m+=10;break;
case 4:if(h<23)h++;break;
case 5:if(h<14)h+=10;break;
}
}
if(keyval==keymin&&mode==set)
{
switch(ledsetbit)
{
case 0:if(s>0)s--;break;
case 1:if(s>10)s-=10;break;
case 2:if(m>0)m--;break;
case 3:if(m>10)m-=10;break;
case 4:if(h>0)h--;break;
case 5:if(h>10)h-=10;break;
}
}
void display(uchar h,uchar m,uchar s)
{
unsigned int t=100;
switch(ledbit)
{
case 0:led(s%10,ledbit);
case 1:led(s/10,ledbit);
case 2:led(m%10,ledbit);
case 3:led(m/10,ledbit);
case 4:led(h%10,ledbit);
case 5:led(h/10,ledbit);
}
ledbit++;
if(ledbit>5)ledbit=0;
while(t--);
}