void fill_animation_battery_ver_2(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOG_ANIM("[show_animation_common: %s %d]capacity : %d\n",__FUNCTION__,__LINE__, capacity); // RECT_REGION_T wireless_bgd_rect = {0, 0, phical_screen.width, phical_screen.height}; charging_low_index >= 3? charging_low_index = 0:charging_low_index++; LOG_ANIM("[show_animation_common: %s %d]charging_low_index = %d\n",__FUNCTION__,__LINE__, charging_low_index); if (capacity >= 100) { // battery 100 fill_animation_logo(V2_BAT_100_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); } else if (capacity <= 0) { fill_animation_logo(V2_BAT_0_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); } else { int bg_index = V2_BAT_0_10_START_INDEX; //capacity > 0 && capacity < 10 if (capacity >= 10 && capacity < 40) { bg_index = V2_BAT_10_40_START_INDEX; } else if (capacity >= 40 && capacity < 80) { bg_index = V2_BAT_40_80_START_INDEX; } else if (capacity >= 80 && capacity < 100) { bg_index = V2_BAT_80_100_START_NDEX; } fill_animation_logo(bg_index + charging_low_index, fill_addr, dec_logo_addr, logo_addr,phical_screen); RECT_REGION_T tmp_rect = {(int)phical_screen.width * 4/10, (int) phical_screen.height * 1/6, (int)phical_screen.width* 5/10, (int)phical_screen.height*16/60 }; unsigned short tmp_num_addr[(int)phical_screen.width * phical_screen.height/100]; //addr if (capacity >= 10) { LOG_ANIM("[show_animation_common: %s %d]tmp_rect left = %d, right = %d,top = %d,bottom = %d,\n",__FUNCTION__,__LINE__, tmp_rect.left,tmp_rect.right,tmp_rect.top,tmp_rect.bottom); fill_animation_dynamic(V2_NUM_START_0_INDEX + (capacity/10), tmp_rect, fill_addr, tmp_num_addr, logo_addr, phical_screen); tmp_rect.left += (int)phical_screen.width /10; tmp_rect.right += (int)phical_screen.width /10; } LOG_ANIM("[show_animation_common: %s %d]tmp_rect left = %d, right = %d,top = %d,bottom = %d,\n",__FUNCTION__,__LINE__, tmp_rect.left,tmp_rect.right,tmp_rect.top,tmp_rect.bottom); fill_animation_dynamic(V2_NUM_START_0_INDEX + (capacity%10), tmp_rect, fill_addr, tmp_num_addr, logo_addr, phical_screen); tmp_rect.left += (int)phical_screen.width /10; tmp_rect.right += (int)phical_screen.width /10; LOG_ANIM("[show_animation_common: %s %d]tmp_rect left = %d, right = %d,top = %d,bottom = %d,\n",__FUNCTION__,__LINE__, tmp_rect.left,tmp_rect.right,tmp_rect.top,tmp_rect.bottom); fill_animation_dynamic(V2_NUM_PERCENT_INDEX, tmp_rect, fill_addr, tmp_num_addr, logo_addr, phical_screen); } }
/* * Show charging animation version 1 * */ void fill_animation_battery_ver_1(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { LOG_ANIM("[show_animation_common: %s %d]capacity : %d\n",__FUNCTION__,__LINE__, capacity); if (capacity >= 100) { //show_logo(37); // battery 100 fill_animation_logo(FULL_BATTERY_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); } else if (capacity < 10) { LOG_ANIM("[show_animation_common: %s %d]charging_low_index = %d\n",__FUNCTION__,__LINE__, charging_low_index); charging_low_index ++ ; fill_animation_logo(LOW_BAT_ANIM_START_0 + charging_low_index, fill_addr, dec_logo_addr, logo_addr,phical_screen); fill_animation_number(NUMBER_PIC_START_0 + capacity, 1, fill_addr, logo_addr, phical_screen); fill_animation_dynamic(NUMBER_PIC_PERCENT, percent_location_rect, fill_addr, percent_pic_addr, logo_addr, phical_screen); if (charging_low_index >= 9) charging_low_index = 0; } else { unsigned int capacity_grids = 0; //static RECT_REGION_T battery_rect = {CAPACITY_LEFT,CAPACITY_TOP,CAPACITY_RIGHT,CAPACITY_BOTTOM}; capacity_grids = CAPACITY_BOTTOM - (CAPACITY_BOTTOM - CAPACITY_TOP) * (capacity - 10) / 90; LOG_ANIM("[show_animation_common: %s %d]capacity_grids : %d,charging_animation_index = %d\n",__FUNCTION__,__LINE__, capacity_grids,charging_animation_index); //background fill_animation_logo(ANIM_V1_BACKGROUND_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); fill_animation_line(ANIM_LINE_INDEX, capacity_grids, fill_addr, logo_addr, phical_screen); fill_animation_number(NUMBER_PIC_START_0 + (capacity/10), 0, fill_addr, logo_addr, phical_screen); fill_animation_number(NUMBER_PIC_START_0 + (capacity%10), 1, fill_addr, logo_addr, phical_screen); fill_animation_dynamic(NUMBER_PIC_PERCENT, percent_location_rect, fill_addr, percent_pic_addr, logo_addr, phical_screen); if (capacity <= 90) { RECT_REGION_T top_animation_rect = {TOP_ANIMATION_LEFT, capacity_grids - (TOP_ANIMATION_BOTTOM - TOP_ANIMATION_TOP), TOP_ANIMATION_RIGHT, capacity_grids}; //top_animation_rect.bottom = capacity_grids; //top_animation_rect.top = capacity_grids - top_animation_height; charging_animation_index++; //show_animation_dynamic(15 + charging_animation_index, top_animation_rect, top_animation_addr); fill_animation_dynamic(BAT_ANIM_START_0 + charging_animation_index, top_animation_rect, fill_addr, top_animation_addr, logo_addr, phical_screen); if (charging_animation_index >= 9) charging_animation_index = 0; } } }
/* * Show charging animation version 0 * */ void fill_animation_battery_ver_0(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { unsigned int capacity_grids = 0; if (capacity > 100) capacity = 100; capacity_grids = (capacity * (ANIM_V0_REGIONS)) / 100; LOG_ANIM("[show_animation_common: %s %d]capacity =%d, capacity_grids = %d\n",__FUNCTION__,__LINE__, capacity, capacity_grids); //show_logo(1); fill_animation_logo(ANIM_V0_BACKGROUND_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); // Fill Occupied Color //RECT_REGION_T bar_rect = {BAR_LEFT, BAR_TOP, BAR_RIGHT, BAR_BOTTOM}; RECT_REGION_T rect_bar = {bar_rect.left + 1, bar_rect.top + 1, bar_rect.right, bar_rect.bottom}; // RECT_REGION_T rect_bar = {BAR_LEFT + 1, BAR_TOP + 1,BAR_RIGHT, BAR_BOTTOM}; fill_animation_prog_bar(rect_bar, (unsigned int)(BAR_OCCUPIED_COLOR), 0, capacity_grids, fill_addr, phical_screen); fill_animation_prog_bar(rect_bar, (unsigned int)(BAR_EMPTY_COLOR), capacity_grids, ANIM_V0_REGIONS - capacity_grids, fill_addr, phical_screen); }
/* * Show lod charging animation * */ void fill_animation_battery_old(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen) { int capacity_grids = 0; if (capacity > 100) capacity = 100; capacity_grids = (capacity * (ANIM_V0_REGIONS)) / 100; if (version0_charging_index < capacity_grids * 2) version0_charging_index = capacity_grids * 2; if (capacity < 100){ version0_charging_index > 7? version0_charging_index = capacity_grids * 2 : version0_charging_index++; } else { version0_charging_index = ANIM_V0_REGIONS * 2; } fill_animation_logo(ANIM_V0_BACKGROUND_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen); RECT_REGION_T rect_bar = {bar_rect.left + 1, bar_rect.top + 1, bar_rect.right, bar_rect.bottom}; fill_animation_prog_bar(rect_bar, (unsigned int)(BAR_OCCUPIED_COLOR), 0, version0_charging_index/2, fill_addr, phical_screen); fill_animation_prog_bar(rect_bar, (unsigned int)(BAR_EMPTY_COLOR), version0_charging_index/2, ANIM_V0_REGIONS - version0_charging_index/2, fill_addr, phical_screen); }
/* * Show charging over logo * */ void mt_disp_show_charger_ov_logo(void) { dprintf(INFO, "[lk logo: %s %d]\n",__FUNCTION__,__LINE__); mt_logo_get_custom_if(); if(logo_cust_if->show_boot_logo) { logo_cust_if->show_boot_logo(); } else { init_fb_screen(); fill_animation_logo(CHARGER_OV_INDEX, mt_get_fb_addr(), mt_get_tempfb_addr(), logo_addr, phical_screen); mt_disp_update(0, 0, CFG_DISPLAY_WIDTH, CFG_DISPLAY_HEIGHT); } return; }