void app_lcd_power_timer(int eid)
{
app_t *curapp = GET_CURR_APP();
static int time_300S = 30;//300s
static int time_120S = 12;//120s
static int time_30S = 3;//30s
if (eid == TIMER_UNREGISTER) {
time_30S = 3;
time_120S = 12;
time_300S = 30;
return;
}
if(usb_connect)
return;
if (sys_status.pref->power_Lcd_off == SYSSET_LCD_OFF_30S)
{
time_30S--;
if (time_30S==0)
{
time_30S = 3;
app_set_backlight(0);
AutoLcdOffFlag=1;
}
}
else if (sys_status.pref->power_Lcd_off == SYSSET_LCD_OFF_120S)
{
time_120S--;
if (time_120S==0)
{
time_120S = 12;
app_set_backlight(0);
AutoLcdOffFlag =1;
}
}
else if (sys_status.pref->power_Lcd_off == SYSSET_LCD_OFF_300S)
{
time_300S--;
if (time_300S==0)
{
time_300S = 30;
app_set_backlight(0);
AutoLcdOffFlag =1;
}
}
}
app_timer_unregister(TIMER_CHECK, app_lcd_power_timer);
看这样的例子好多啊