高温截至充电,低温恢复充电,软件修改方法

[FAQ05097][BMT] 高温截至充电,低温恢复充电,软件修改方法

内容
[DESCRIPTION]
默认code,在电池处于高温时,是截至充电的,即使返回常温也不会再充电。我们只需要在软件上面添加一种状态,在高温的时候设置为BATTERY_OVER_TEMP,
返回常温时,把充电状态变回BMT_status.bat_charging_state = CHR_PRE,即可返回充电。
不过有三点需要重点注意:
1.电池必须具有NTC功能(也就是温度检测功能)。
2.我们指的温度,是指电池的温度,不是环境的问题,环境温度可以很快变化,电池温度的变化需要一点时间。
3.如返回常温时,还不能充电,请捉取一份log给我司分析。
[PLATFORM]
MT6575 MT6515 MT6577 MT6517 MT6589

1.文件开头加上#define BATTERY_OVER_TEMP
32.在函数BAT_CheckBatteryStatus(void)中下面两个地方加上两句.
#if (BAT_TEMP_PROTECT_ENABLE == 1)
if ((BMT_status.temperature <= MIN_CHARGE_TEMPERATURE) || (BMT_status.temperature == ERR_CHARGE_TEMPERATURE)) {
printf( "[BATTERY] Battery Under Temperature or NTC fail !!\n\r");
BMT_status.charger_protect_status = BATTERY_OVER_TEMP;//加上这句话
BMT_status.bat_charging_state = CHR_ERROR;
return PMU_STATUS_FAIL;
}

endif

if (BMT_status.temperature >= MAX_CHARGE_TEMPERATURE)
{
printf( "[BATTERY] Battery Over Temperature !!\n\r");
BMT_status.charger_protect_status = BATTERY_OVER_TEMP;//加上这句话
BMT_status.bat_charging_state = CHR_ERROR;
return PMU_STATUS_FAIL;
}

3.请在BAT_BatteryStatusFailAction(void)后面加上
if ((BMT_status.temperature <= (MAX_CHARGE_TEMPERATURE - 5)) && // 小于MAX_CHARGE_TEMPERATURE-5以及高于MIN_CHARGE_TEMPERATURE+5的时候恢复充电
(BMT_status.temperature >= (MIN_CHARGE_TEMPERATURE + 5))&& (BMT_status.temperature != ERR_CHARGE_TEMPERATURE)&& (BMT_status.charger_protect_status == BATTERY_OVER_TEMP))
{
BMT_status.bat_charging_state = CHR_PRE;
BMT_status.charger_protect_status = 0;
if (Enable_BATDRV_LOG == 1)
{
printf( "[BATTERY] temperture in range... start charging again!!\n\r");
}
}

你可能感兴趣的:(高温截至充电,低温恢复充电,软件修改方法)