MT6735 Battery充電開關

NO IMAGE

在battery_common.c中

函式battery_update

	if(flg == 1)//開啟充電開關
{
if ((BMT_status.charger_exist == KAL_TRUE) && (BMT_status.bat_charging_state != CHR_ERROR)) {
if (BMT_status.bat_exist) {	/* charging */
if (BMT_status.bat_vol <= V_0PERCENT_TRACKING) {
resetBatteryMeter = mt_battery_0Percent_tracking_check();
} else {
resetBatteryMeter = mt_battery_100Percent_tracking_check();
}
bat_data->BAT_STATUS = POWER_SUPPLY_STATUS_CHARGING;
} else {	/* No Battery, Only Charger */
bat_data->BAT_STATUS = POWER_SUPPLY_STATUS_UNKNOWN;
BMT_status.UI_SOC = 0;
}
} else {		/* Only Battery */
bat_data->BAT_STATUS = POWER_SUPPLY_STATUS_NOT_CHARGING;
if (BMT_status.bat_vol <= V_0PERCENT_TRACKING)
resetBatteryMeter = mt_battery_0Percent_tracking_check();
else
resetBatteryMeter = mt_battery_nPercent_tracking_check();
}
}else if(flg == 2)//關閉充電開關
{
if ((BMT_status.charger_exist == KAL_TRUE) && (BMT_status.bat_charging_state != CHR_ERROR)) {
if (BMT_status.bat_exist) {	/* charging */
bat_data->BAT_STATUS = POWER_SUPPLY_STATUS_NOT_CHARGING;
if (BMT_status.bat_vol <= V_0PERCENT_TRACKING)
resetBatteryMeter = mt_battery_0Percent_tracking_check();
else
resetBatteryMeter = mt_battery_nPercent_tracking_check();
} else {	/* No Battery, Only Charger */
bat_data->BAT_STATUS = POWER_SUPPLY_STATUS_UNKNOWN;
BMT_status.UI_SOC = 0;
}
} else {		/* Only Battery */
bat_data->BAT_STATUS = POWER_SUPPLY_STATUS_NOT_CHARGING;
if (BMT_status.bat_vol <= V_0PERCENT_TRACKING)
resetBatteryMeter = mt_battery_0Percent_tracking_check();
else
resetBatteryMeter = mt_battery_nPercent_tracking_check();
}
}