Example #1
0
static int shut_battery_full(void)
{
    int  alpha_step, i;
    int  aplha, delay_time;
    display_layer_info_t *layer_para;

    if(!pic_layer_para)
    {
        return -1;
    }
    layer_para = (display_layer_info_t *)pic_layer_para;
    alpha_step = 5;
    delay_time = 50;
    aplha = layer_para->alpha_val;

    for(i=0xff; i>0; i -= alpha_step)
    {
        layer_para->alpha_en = 1;
        aplha -= alpha_step;
        if(aplha > 0)
        {
            De_SetLayerPara(board_res.layer_hd, layer_para);
            wBoot_timer_delay(delay_time);
            layer_para->alpha_val = aplha;
        }
        else
        {
            break;
        }
    }

    return 0;
}
/*
*******************************************************************************
*                     ShowLayer
*
* Description:
*    显示图层
*
* Parameters:
*    layer_hdl   :  input. 图层句柄
*    layer_para  :  input. 图层参数
*
* Return value:
*    0  :  成功
*   !0  :  失败
*
* note:
*    void
*
*******************************************************************************
*/
__s32 ShowLayer(__hdle layer_hdl, display_layer_info_t *layer_para)
{
	__s32 ret = 0;

	WaitForDeInitFinish();
	ret = De_SetLayerPara(layer_hdl, layer_para);
	if(ret != 0)
	{
		DMSG_PANIC("ERR: De_SetLayerPara failed\n");
		return -1;
	}
	/* 显示 */
	De_OpenLayer(layer_hdl);

	return 0;
}
Example #3
0
int ShowBatteryCharge_reset(__u32 pic_hd)
{
	bat_charge_show *battery_info = NULL;

	if(!pic_hd)
    {
        return -1;
    }

	battery_info = (bat_charge_show *)pic_hd;

    battery_info->layer_para->alpha_en = 1;
    battery_info->layer_para->alpha_val = 255;
    wBoot_timer_delay(50);
    De_SetLayerPara(board_res.layer_hd, battery_info->layer_para);
}
/*
*******************************************************************************
*                     ShowLayer
*
* Description:
*    显示图层
*
* Parameters:
*    layer_hdl   :  input. 图层句柄
*    layer_para  :  input. 图层参数
*
* Return value:
*    0  :  成功
*   !0  :  失败
*
* note:
*    void
*
*******************************************************************************
*/
__s32 ShowLayer(__hdle layer_hdl, display_layer_info_t *layer_para, __s32 layer_source)
{
	__s32 ret = 0;
#ifndef SPEED_UP_BOOT
    if(!layer_source)
    {
	    WaitForDeInitFinish();
    }
#endif
	ret = De_SetLayerPara(layer_hdl, layer_para);
	if(ret != 0){
		DMSG_PANIC("ERR: De_SetLayerPara failed\n");
		return -1;
	}
	/* 显示 */
	De_OpenLayer(layer_hdl);

	return 0;
}
__s32 ShowBatteryCharge_degrade(__u32 pic_hd, int step_time)
{
	bat_charge_show *battery_info = NULL;
	int  alpha_step, i;
	int  aplha, delay_time;

	if(!pic_hd)
    {
        return -1;
    }
//    if(step_time <= 0)
//    {
//    	step_time = 10;
//    }
//    else if(step_time > 10)
//    {
//    	step_time = 10;
//    }
    battery_info = (bat_charge_show *)pic_hd;
	alpha_step = 5;
	delay_time = 50;
	aplha = battery_info->layer_para->alpha_val;

	for(i=0xff;i>0;i -= alpha_step)
	{
		battery_info->layer_para->alpha_en = 1;
		aplha -= alpha_step;
		if(aplha > 0)
		{
			De_SetLayerPara(board_res.layer_hd, battery_info->layer_para);
			wBoot_timer_delay(delay_time);
			battery_info->layer_para->alpha_val = aplha;

		}
		else
		{
			break;
		}
	}

	return 0;
}
Example #6
0
__s32 ShowBatteryCharge_degrade(__u32 pic_hd, int step_time)
{
	bat_charge_show *battery_info = NULL;
	int  alpha_step;
	int  alpha, delay_time;
	//int  i;

	if(!pic_hd)
    {
        return -1;
    }

    battery_info = (bat_charge_show *)pic_hd;
	alpha_step = 5;
	delay_time = 50;
	alpha = battery_info->layer_para->alpha_val;

	battery_info->layer_para->alpha_en = 1;
	alpha -= alpha_step;
	if(alpha > 0)
	{
		De_SetLayerPara(board_res.layer_hd, battery_info->layer_para);
		wBoot_timer_delay(delay_time);
		battery_info->layer_para->alpha_val = alpha;
	}
	else
	{
		return -1;
	}
//	else
//	{
//		break;
//	}
//	}

	return 0;
}