unsigned char task_delay[4];
void timer0_init()
{
unsigned char i;
for(i=0;i<max_task;i++)
task_delay[i]=0;
TMOD=0x01;
TH0=255-clock/time_per_sec/12/256;
TL0=255-clock/time_per_sec/12%256;
TR0=1;
ET0=1;
}
void timer0() interrupt 1
{
unsigned char i;
TH0=255-clock/time_per_sec/12/256;
TL0=255-clock/time_per_sec/12%256;
for(i=0;i<max_task;i++)
if(task_delay[i])
task_delay[i]--; //这方括号里面的i代表什么的,为什么是i |