问题描述:充电的时候,有三种模式,PC(预充),CC(恒流),VC(恒压).在uboot充电延时,CC MODE未充满会提示100%的问题
--- a/mediatek/platform/mt6577/uboot/mt6577_bat.c +++ b/mediatek/platform/mt6577/uboot/mt6577_bat.c @@ -1762,6 +1762,13 @@ void check_point_sync_leds(void) leds_battery_medium_charging(); } } +extern int capacity_timer_start; +extern int capacity_full_flag; + +static int capacity_seconds=0; +static int capacity_minutes=0; void mt65xx_bat_init(void) { @@ -1960,7 +1967,28 @@ void mt65xx_bat_init(void) upmu_chr_baton_tdet_en(1); // sw workaround : 26M off if (loop_count++ == 60) loop_count = 0; + if(capacity_timer_start == 1) + { + capacity_seconds++; + if(capacity_seconds>=5*60) + { + printf("[mt65xx_bat_init] capacity_seconds = %d,capacity_minutes=%d\n",capacity_seconds,capacity_minutes); + capacity_seconds = 0; + capacity_minutes++; + if(capacity_minutes >=20) + { + capacity_minutes = 0; + capacity_full_flag = 1; + } + } + } + else + { + capacity_seconds = 0; + capacity_minutes = 0; + } if (mt6577_detect_key(BACKLIGHT_KEY) || (!mt6577_detect_powerkey() && press_pwrkey_count > 0)) { bl_switch = false;
--- a/mediatek/platform/mt6577/uboot/mt65xx_logo.c +++ b/mediatek/platform/mt6577/uboot/mt65xx_logo.c @@ -140,7 +140,10 @@ int capacity_zero = 0; int capacity_zero_index = 0; //for new - +int capacity_timer_start=0; +int capacity_full_flag = 0; bool mt65xx_logo_decompress(void *in, void *out, int inlen, int outlen) { @@ -739,7 +742,25 @@ void mt65xx_disp_show_battery_full(void) else { #ifdef ANIMATION_NEW - cust_show_battery_capacity_new(100); +// cust_show_battery_capacity_new(100); + if(capacity_timer_start == 0) + { + capacity_timer_start = 1; + printf("[mt65xx_disp_show_battery_full] timer start \n"); + } + + if(capacity_full_flag == 0) + { + cust_show_battery_capacity_new(99); + printf("[mt65xx_disp_show_battery_full] 99 \n"); + } + else + { + cust_show_battery_capacity_new(100); + printf("[mt65xx_disp_show_battery_full] 100 \n"); + } #else cust_show_battery_capacity(100); #endif @@ -759,7 +780,20 @@ void mt65xx_disp_show_battery_capacity(UINT32 capacity) else { #ifdef ANIMATION_NEW - cust_show_battery_capacity_new(capacity); +// cust_show_battery_capacity_new(capacity); + if(capacity == 100) + { + cust_show_battery_capacity_new(99); + } + else + { + printf("[mt65xx_disp_show_battery_full] timer off capacity = %d\n",capacity); + capacity_timer_start = 0; + capacity_full_flag= 0; + cust_show_battery_capacity_new(capacity); + } #else cust_show_battery_capacity(capacity); #endif