tl1 = clock_40ms & 0xff; //timer1:40ms
th1 = clock_40ms > > 8;
led1on( );
// fgled2on = 0;
fgchange = 0;
et1 = 1; //enable timer1 interrupt
ea = 1; //enable all interrupt
tr1 = 1;
ledoffcount=time_5sec;
while( 1 )
{
if ( fgchange==0 )
{
if(ledoffcount==0)
{
fgchange=1;
led1off();
}
}
}
}
void ledoff_time1isr (void) interrupt 3 using 2
{
int timer40mscount=0;
int ledoffcount;
tl1=clock_40ms & 0xff;
th1=clock_40ms > > 8;
tf1=0;
timer40mscount++;
if (ledoffcount !=0)
ledoffcount--;
}