|
@@ -7,8 +7,6 @@
|
|
#include "hal_charge.h"
|
|
#include "hal_charge.h"
|
|
#include "fml_adc.h"
|
|
#include "fml_adc.h"
|
|
#include "app_chargerpin_conn_detect.h"
|
|
#include "app_chargerpin_conn_detect.h"
|
|
-#include "drv_trigger.h"
|
|
|
|
-
|
|
|
|
#define PRINTBLE 0
|
|
#define PRINTBLE 0
|
|
|
|
|
|
#define IIDUAN 1
|
|
#define IIDUAN 1
|
|
@@ -92,7 +90,7 @@ void cb_init(void)
|
|
//返回5V信号,有5V的话返回1,没有的话返回0
|
|
//返回5V信号,有5V的话返回1,没有的话返回0
|
|
static char charge_in(void)
|
|
static char charge_in(void)
|
|
{
|
|
{
|
|
- if (drv_GetChargeTrig())
|
|
|
|
|
|
+ if (nrf_gpio_pin_read(PIN_CHARGING))
|
|
{
|
|
{
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
@@ -393,6 +391,7 @@ static float Power_management(float mV_Battery, float mV_Charge)
|
|
battercb->sta = 2; //充电过程
|
|
battercb->sta = 2; //充电过程
|
|
battercb->kg = 0;
|
|
battercb->kg = 0;
|
|
battercb->Battery_capacity_mAh = mah2Voltage(battercb->P1, storage_capacity);
|
|
battercb->Battery_capacity_mAh = mah2Voltage(battercb->P1, storage_capacity);
|
|
|
|
+ log("in %f\r\n",battercb->P1);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -413,6 +412,7 @@ static float Power_management(float mV_Battery, float mV_Charge)
|
|
case 2://充电
|
|
case 2://充电
|
|
if (mV_Charge < 20)
|
|
if (mV_Charge < 20)
|
|
{
|
|
{
|
|
|
|
+ log("out %f\r\n",battercb->P1);
|
|
battercb->sta = 1; //放电过程
|
|
battercb->sta = 1; //放电过程
|
|
//初始化滤波器波器
|
|
//初始化滤波器波器
|
|
battercb->preBestResult_Voltage2power = mV_Battery / 10;
|
|
battercb->preBestResult_Voltage2power = mV_Battery / 10;
|
|
@@ -423,6 +423,7 @@ static float Power_management(float mV_Battery, float mV_Charge)
|
|
// #endif
|
|
// #endif
|
|
{
|
|
{
|
|
battercb->P1 = 100.0f;
|
|
battercb->P1 = 100.0f;
|
|
|
|
+ log("full %f\r\n",battercb->P1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|