Пример #1
0
static void drv_lcd_open_callback(void *parg)
{
    disp_lcd_flow *flow;
    u32 sel = (u32)parg;
    s32 i = lcd_flow_cnt[sel]++;

    flow = bsp_disp_lcd_get_open_flow(sel);

	if(i < flow->func_num)
    {
    	flow->func[i].func(sel);
        if(flow->func[i].delay == 0)
        {
            drv_lcd_open_callback((void*)sel);
        }
        else
        {
        	lcd_timer[sel].data = sel;
			lcd_timer[sel].expires = flow->func[i].delay;
			lcd_timer[sel].function = drv_lcd_open_callback;
			add_timer(&lcd_timer[sel]);
    	}
    }
    else if(i == flow->func_num)
    {
        bsp_disp_lcd_post_enable(sel);
        lcd_op_finished[sel] = 1;
    }
}
// [before][step_0][delay_0][step_1][delay_1]......[step_n-2][delay_n-2][step_n-1][delay_n-1][after]
void DRV_lcd_open_callback(void *parg)
{
    __lcd_flow_t *flow;
    __u32 sel = (__u32)parg;
    __s32 i = lcd_flow_cnt[sel]++;

    flow = bsp_disp_lcd_get_open_flow(sel);

	if(i < flow->func_num)
    {
    	flow->func[i].func(sel);
        if(flow->func[i].delay == 0)
        {
        	DRV_lcd_open_callback((void*)sel);
        }
        else
        {
        	lcd_timer[sel].data = sel;
			lcd_timer[sel].expires = flow->func[i].delay;
			lcd_timer[sel].function = DRV_lcd_open_callback;
			add_timer(&lcd_timer[sel]);
    	}
    }
    else if(i == flow->func_num)
    {
    	bsp_disp_lcd_open_after(sel);
        lcd_op_finished[sel] = 1;
    }
}