Exemplo n.º 1
0
void cust_show_battery_capacity(UINT32 capacity)
{
#if MTK_QVGA_LANDSCAPE_SUPPORT
//	DISP_PROG_BAR_DIRECT direct = DISP_HORIZONTAL_PROG_BAR;
#else
//	DISP_PROG_BAR_DIRECT direct = DISP_VERTICAL_PROG_BAR;
#endif
	DISP_PROG_BAR_DIRECT direct = DISP_VERTICAL_PROG_BAR;
    UINT32 capacity_grids = 0;
 
    if (capacity > 100) capacity = 100;

    capacity_grids = (capacity * VOLTAGE_SCALE) / 100;

    show_logo(1);

    // Fill Occupied Color
    
    mt65xx_disp_draw_prog_bar(direct,
                              bar_rect.left + 1, bar_rect.top + 1,
                              bar_rect.right, bar_rect.bottom,
                              bar_occupied_color, bar_bg_color,
                              0, VOLTAGE_SCALE, capacity_grids);
    
    // Fill Empty Color
    
    mt65xx_disp_draw_prog_bar(direct,
                              bar_rect.left + 1, bar_rect.top + 1,
                              bar_rect.right, bar_rect.bottom,
                              bar_empty_color, bar_bg_color,
                              capacity_grids, VOLTAGE_SCALE,
                              VOLTAGE_SCALE - capacity_grids);

    mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
}
Exemplo n.º 2
0
UINT32 mt65xx_disp_get_lcd_time(void)
{
#if 0
	UINT32 time0, time1, lcd_time;
	mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);

    LCD_CHECK_RET(LCD_WaitForNotBusy());

	time0 = gpt4_tick2time_us(gpt4_get_current_tick());
    LCD_CHECK_RET(LCD_StartTransfer(FALSE));

	if (lcm_params->type==LCM_TYPE_DSI && lcm_params->dsi.mode==CMD_MODE) {
		DSI_clk_HS_mode(1);
		DSI_CHECK_RET(DSI_EnableClk());
	}
	else if (lcm_params->type==LCM_TYPE_DSI && lcm_params->dsi.mode!=CMD_MODE) {
		DSI_clk_HS_mode(1);
		DPI_CHECK_RET(DPI_EnableClk());
		DSI_CHECK_RET(DSI_EnableClk());
	}
    LCD_CHECK_RET(LCD_WaitForNotBusy());

	time1 = gpt4_tick2time_us(gpt4_get_current_tick());

	lcd_time = time1 - time0;
	printf("lcd one %d \n", lcd_time);
	if(0 != lcd_time)	
		return (100000000/lcd_time);
	else
#endif
		return (6000);
}
Exemplo n.º 3
0
/*******************************************************
 * Routine: misc_init_r
 * Description: Init ethernet (done here so udelay works)
 ********************************************************/
int misc_init_r (void)
{
    int ret = 0;
#ifdef CFG_UBOOT_PROFILING    
    unsigned int time_load_logo;
    unsigned int time_boot_mode;
    unsigned int time_part_init;
#endif

#ifdef CFG_UBOOT_PROFILING
      time_part_init = get_timer(0);
#endif
    mt6575_part_init(BLK_NUM(16 * GB));
   // mt6575_part_dump();
#ifdef CFG_UBOOT_PROFILING
      printf("[PROFILE] ------- part_init takes %d ms -------- \n", get_timer(time_part_init));
#endif        

    //*****************
    //* check mode (1) factory mode (2) meta mode ...
#ifdef CFG_UBOOT_PROFILING
      time_boot_mode = get_timer(0);
#endif
    boot_mode_select();
#ifdef CFG_UBOOT_PROFILING
      printf("[PROFILE] ------- boot mode select takes %d ms -------- \n", get_timer(time_boot_mode));
#endif      
    
#if 1 //Remove tmp for 6575 porting

#ifdef CONFIG_MMC
    mmc_legacy_init(1);
 mt6575_part_dump();
#endif

#ifdef CFG_UBOOT_PROFILING
      time_load_logo = get_timer(0);
#endif    
    ret = mboot_common_load_logo((unsigned long)mt65xx_get_logo_db_addr(),
                    CFG_LOGO_NAME);

	printf("Show BLACK_PICTURE\n");
	mt65xx_disp_fill_rect(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT, 0x0);
	mt65xx_disp_power(TRUE);
	mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);

#ifdef CFG_UBOOT_PROFILING
      printf("[PROFILE] ------- load_logo takes %d ms -------- \n", get_timer(time_load_logo));
#endif  
                    
    if (ret <= 0)
    {
        printf("[ERROR] load logo partition failed, ret: %d\n", ret);
    }    

    return 0;
#endif//Remove tmp for 6575 porting    
}
Exemplo n.º 4
0
// this is a sample code for how to draw the logo by yourself.
void cust_show_boot_logo(void)
{
    void  *fb_addr = mt65xx_get_fb_addr();
    UINT32 fb_size = mt65xx_get_fb_size();
    void  *db_addr = mt65xx_get_logo_db_addr();

    memcpy(fb_addr, (UINT32)db_addr + fb_size * 0, fb_size);

    mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
}
Exemplo n.º 5
0
void mt65xx_disp_show_low_battery(void)
{
    mt65xx_logo_get_custom_if();

    if(logo_cust_if->show_boot_logo)
    {
    	logo_cust_if->show_boot_logo();
    }
    else
    {
        show_logo(2);
        mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
    }

    return;
}
Exemplo n.º 6
0
void mt65xx_disp_show_boot_logo(void)
{
#ifndef CFG_MT6577_FPGA
    mt65xx_logo_get_custom_if();

    if(logo_cust_if->show_boot_logo)
    {
    	logo_cust_if->show_boot_logo();
    }
    else
    {
        show_logo(0);
        mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
    }

    return;
#endif
}
void cust_show_battery_capacity_new(UINT32 capacity)
{
#if MTK_QVGA_LANDSCAPE_SUPPORT
//	DISP_PROG_BAR_DIRECT direct = DISP_HORIZONTAL_PROG_BAR;
#else
//	DISP_PROG_BAR_DIRECT direct = DISP_VERTICAL_PROG_BAR;
#endif
	DISP_PROG_BAR_DIRECT direct = DISP_VERTICAL_PROG_BAR;

        printf("[ChargingAnimation]capacity : %d\n", capacity);

        if (capacity <= 0) 
          {
             //show_logo(2);
             //mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);	
             //return;

            //capacity_zero ++;
            // if (capacity_zero > 10) capacity_zero = 2;
            // if (capacity_zero > 1)
            //   {
                  show_logo(29+capacity_zero_index);
#ifndef NO_PERCENT_NEW
                  show_animation_number(number_pic_start_0,1);
                  show_animation(14, percent_location_rect, percent_pic_addr);
#endif
                  if(++capacity_zero_index > 1)  capacity_zero_index = 0;
                  mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);	
                  return;
           //    }               
          }
        //else 
        //  {
        //     capacity_zero = 0;
        //  }

        
        if (capacity < 10 && capacity > 0) 
          {
             charging_low_index ++ ;
             show_logo(25 + charging_low_index);
             if (charging_low_index >= 9) charging_low_index = 0;
#ifndef NO_PERCENT_NEW
             show_animation_number(number_pic_start_0+capacity,1);
             show_animation(14, percent_location_rect, percent_pic_addr);
#endif
             mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);	
             return;
          }

        if (capacity >= 100) 
          {
             show_logo(37); // battery 100
             mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);	
             return;
          }

	UINT32 capacity_grids = 0;     
	//if (capacity > 100) capacity = 100;
	capacity_grids = battery_rect.bottom - (battery_rect.bottom - battery_rect.top) * (capacity - 10) / 90;
	printf("[ChargingAnimation]capacity : %d\n", capacity);
        printf("[ChargingAnimation]capacity_grids : %d\n", capacity_grids);
        show_logo(35);  // show background
        show_animation_line(36,capacity_grids); // show battery capacity line
        
        top_animation_rect.bottom = capacity_grids;
        top_animation_rect.top = capacity_grids - top_animation_height;
        if (capacity <= 90) 
          {
            charging_animation_index++;
            printf("[ChargingAnimation]top_animation : left = %d, top = %d, right = %d, bottom = %d\n",  top_animation_rect.left, top_animation_rect.top,  top_animation_rect.right, top_animation_rect.bottom);
            show_animation(15 + charging_animation_index, top_animation_rect, top_animation_addr); // show top animation
            if (charging_animation_index >= 9) charging_animation_index = 0;
         }

       if ((capacity >= 0)&&(capacity < 10))
	{
#ifndef NO_PERCENT_NEW
		show_animation_number(number_pic_start_0+capacity,1);
#endif
	}
	
	if ((capacity >= 10)&&(capacity < 100))
	{
#ifndef NO_PERCENT_NEW
		show_animation_number(number_pic_start_0+(capacity/10),0);
		show_animation_number(number_pic_start_0+(capacity%10),1);	
#endif	
	}
#ifndef NO_PERCENT_NEW
        show_animation(14, percent_location_rect, percent_pic_addr);
#endif

        mt65xx_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT);
}