Exemplo n.º 1
0
__s32 DRV_lcd_open(__u32 sel)
{
	__u32 i = 0;
	__lcd_flow_t *flow;

	if (g_disp_drv.b_lcd_open[sel] == 0) {
		BSP_disp_lcd_open_before(sel);

		flow = BSP_disp_lcd_get_open_flow(sel);
		for (i = 0; i < flow->func_num; i++) {
			__u32 timeout = flow->func[i].delay * HZ / 1000;

			flow->func[i].func(sel);

			set_current_state(TASK_INTERRUPTIBLE);
			schedule_timeout(timeout);

		}

		BSP_disp_lcd_open_after(sel);

		g_disp_drv.b_lcd_open[sel] = 1;
	}

	return 0;
}
// [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);
    __inf("lcd %d timeout=%d\n", i, flow->func[i].delay);
	if(i < flow->func_num)
    {
    	flow->func[i].func(sel);
        if(flow->func[i].delay == 0)
        {
            DRV_lcd_open_callback((void*)sel);
        }
        else
        {
            wBoot_timer_start(lcd_timer[sel], flow->func[i].delay, 0);
    	}
    }
    else if(i == flow->func_num)
    {
        BSP_disp_lcd_open_after(sel);
        lcd_op_finished[sel] = 1;
    }
}
Exemplo n.º 3
0
//run the last step of lcd open flow(backlight)
__s32 disp_lcd_open_late(__u32 sel)
{
    __lcd_flow_t *flow;

	if(g_disp_drv.b_lcd_open[sel] == 0)
	{
        flow = BSP_disp_lcd_get_open_flow(sel);
        flow->func[flow->func_num-1].func(sel);
        flow->cur_step = 0;
        
	    BSP_disp_lcd_open_after(sel);

		g_disp_drv.b_lcd_open[sel] = 1;
	}

    return 0;
}
Exemplo n.º 4
0
__s32 DRV_lcd_open(__u32 sel)
{    
    __u32 i = 0;
    __lcd_flow_t *flow;
    
    BSP_disp_lcd_open_before(sel);

    flow = BSP_disp_lcd_get_open_flow(sel);
    for(i=0; i<flow->func_num; i++)
    {
        flow->func[i].func(sel);
        esKRNL_TimeDly(flow->func[i].delay / 10);
    }

    BSP_disp_lcd_open_after(sel);

    return EPDK_OK;
}