void Display(uint sd,uint mm,uint hy)
{ int y0,y1,y2;
if(rili==1)
{
y0=hy/1000,y1=hy%1000;y2=hy%100;
}
for(numwe=0;numwe<8;numwe++)
{
P0=0xff;
wela=1;
P0=we[numwe];
wela=0;
P0=0xff;
dula=1;
switch(numwe)
{
case 0:
P0=(tt==1&set==1)?0x00:(rili==1)?du[y0]:du[hy/10];break;
case 1:
P0=(tt==1&set==2)?0x00:(rili==1)?du[y1/100]:du[hy%10];break;
case 2:
P0=(rili!=1)?0x40:(tt==1&set==3)?0x00:du[y2/10];break;
case 3:
P0=(tt==1&set==4)?0x00:(rili==1)?du[hy%10]+0x80:du[mm/10];break;
case 4:
P0=(tt==1&set==5)?0x00:(rili==1)?du[mm/10]:du[mm%10];break;
case 5:
P0=(rili!=1)?0x40:(tt==1&set==6)?0x00:du[mm%10]+0x80;break;
case 6:
P0=(tt==1&set==7)?0x00:du[sd/10];break;
case 7:
P0=(tt==1&set==8)?0x00:du[sd%10];break;
}
dula=0;
Delay(5);
}
}
|