??????????????????
???????????? ???????[ 2011/11/3 13:10:50 ] ????????
?? ?????????????????ж???????????е??????????????????timer????????????????????????
????????????????α??????????time???λ?ms????
//????timer handle
time_handle register_once_timer(int time_count??func callback_fun);
//????timer handle??????????????????????????????
bool restart_once_timer(time_handle th?? int time_count??func callback_fun);
????????????????????????????????????
void ItemTimerStart(int time_count)
{
static time_handle ItemTimerId = 0;
if(0 == ItemTimerId )
{
ItemTimerId = register_once_timer (time_count??(func)ItemHandler);
}
else
{
restart_once_timer (ItemTimerId?? time_count??(func)ItemHandler);
}
}
???????step????????£?
void StepTimerStart(int time_count)
{
static time_handle StepTimerId = 0;
if(0 == StepTimerId )
{
StepTimerId = register_once_timer (time_count??(func)StepHandler);
}
else
{
restart_once_timer (StepTimerId ?? time_count??(func)StepHandler);
}
}
?????????????step?????screen id???????ж??????????????????α????????????????id int GetScreenID??void????
????????timer??????????????handler???£?
void ItemHandler(void)
{
ItemTimerStart(30*60*1000);//?趨30???????????????????????????????????????????????????
items[i].DeInit();
i++;
if(i>ItemNum)i=0;
items[i].Init();//??????????entry
s=1;//reset step index
}
void StepHandler(void)
{
switch(i)
{
case ItemX:
switch(s)
{
case StepX:
{
if(XXXX_ScreenID == GetScreenID())
{//??????????е??????
//do something let step going on
s++;
StepTimerStart(5*1000);//5??????????е??????
}
else
{//??????????е????????????????
//?????ж?s????++
StepTimerStart(1000);//?1?????????
}
}
break;
????
case StepEnd:
{//?????е???????
ItemTimerStart(10);//?????л???????????
}
break;
}
break;
????
}
}
?????????????????step?л??????step???????????÷??????????????
????????????????????????????????? ????????????????????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11