bigbaicai

文章转自一牛网论坛 一牛网旗下拥有一牛网论坛、一牛网元器件商城、一牛网技术众包平台等一系列服务于广大工程师的平台,让研发更快、更便捷!

高温高压后如何恢复充电?

0
阅读(58) 评论(0)

在充电的过程中,如果出现高温或者高压的情况下,系统会停止充电,当温度或者充电器的电压值恢复正常后,如何恢复充电?



1.高温后温度正常,恢复充电

mediatek\kernel\drivers\power\battery_common.c
#define RECOVERY_CHARGING_TEMPERATURE xx
mt_battery_checkBatteryTemp()
增加变量static KAL_BOOL g_overTemp = KAL_FALSE;

  1. if(BMT_status.temperature >= MAX_CHARGE_TEMERATURE)

  2. {

  3. battery_xlog_printk(BAT_LOG_CRTI, "[BATTERY] Battery Over Temperature !! \n\r");

  4. status = PMU_STATUS_FAIL;

  5. g_overTemp = KAL_TRUE; //add here

  6. }

复制代码



然后在return status之前增加

  1. if((g_overTemp == KAL_TRUE) && (BMT_status.temperature <= RECOVERY_CHARGING_TEMPERATURE))

  2. {

  3. battery_xlog_printk(BAT_LOG_CRTI, "[BATTERY] recovery charging after over temperature!! \n\r");

  4. g_overTemp = KAL_FALSE;

  5. status = PMU_STATUS_OK;

  6. BMT_status.bat_charging_state = CHR_PRE;

  7. }

复制代码


2.高压后充电器电压恢复正常后恢复充电

  1. mediatek\kernel\drivers\power\battery_common.c

  2. #define RECOVERY_CHARGING_VOLTAGE xx

  3. mt_battery_checkChargerVoltage()

  4. if(BMT_status.charger_exist == KAL_TRUE)

  5. {

  6. ...

  7. //最后添加下面一段code

  8. if((BMT_status.charger_protect_status == charger_OVER_VOL) && (BMT_status.charger_vol <=

  9. RECOVERY_CHARGING_VOLTAGE))

  10. {

  11. battery_xlog_printk(BAT_LOG_CRTI, "[BATTERY] recovery charging afer over voltage !! \r\n");

  12. BMT_status.charger_protect_status = 0;

  13. BMT_status.bat_charging_state = CHR_PRE;

  14. status = PMU_STATUS_OK;

  15. }

  16. }

复制代码

转自一牛网论坛  原文链接:http://bbs.16rd.com/thread-270708-1-1.html