void main(void)
{
static unsigned short Ms_1_Cnt=10; //1ms
static unsigned short Ms_10_Cnt=100;//10ms
static unsigned short S_1_Cnt=10000;//10ms
for(;;)
{
Ms_1_Cnt--;
Ms_10_Cnt--;
S_1_Cnt--;
if(!Ms_1_Cnt)
{
Ms_1_Cnt=10;
}
if(!Ms_10_Cnt)
{
Ms_10_Cnt=100;
}
if(!S_1_Cnt)
{
S_1_Cnt=10000;
}
}
} |