|
@@ -269,6 +269,7 @@ static int _soc_force_capaticy(uint8_t capaticy){
|
|
|
|
|
|
|
|
static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
|
static int ocv_full_count = 0;
|
|
static int ocv_full_count = 0;
|
|
|
|
|
+ static int ocv_force_capaticy = 0;
|
|
|
int changed = 0;
|
|
int changed = 0;
|
|
|
if ((_soc.flags & SOC_FLAG_CALIBRATED) == 0){
|
|
if ((_soc.flags & SOC_FLAG_CALIBRATED) == 0){
|
|
|
return 0;
|
|
return 0;
|
|
@@ -286,10 +287,15 @@ static int _soc_update_by_ocv(uint8_t prev_charge_status){
|
|
|
return 1;
|
|
return 1;
|
|
|
}else if ((!prev_charge_status) && (bms_state_get()->cell_min_vol <= 2900) && (_soc.capacity > 10)) {
|
|
}else if ((!prev_charge_status) && (bms_state_get()->cell_min_vol <= 2900) && (_soc.capacity > 10)) {
|
|
|
/* 如果单电芯最小电压小于2.9v,并且容量大于10%,需要校准到10% */
|
|
/* 如果单电芯最小电压小于2.9v,并且容量大于10%,需要校准到10% */
|
|
|
- return _soc_force_capaticy(10);
|
|
|
|
|
|
|
+ if (ocv_force_capaticy++ >= 10) {
|
|
|
|
|
+ return _soc_force_capaticy(10);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ ocv_force_capaticy = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (chargering || prev_charge_status) {
|
|
if (chargering || prev_charge_status) {
|
|
|
|
|
+ ocv_force_capaticy = 0;
|
|
|
/*
|
|
/*
|
|
|
if (bms_state_get()->ps_charger_mask && !bms_state_get()->ps_charger_in) { //ps100 上报无充电器,不做处理
|
|
if (bms_state_get()->ps_charger_mask && !bms_state_get()->ps_charger_in) { //ps100 上报无充电器,不做处理
|
|
|
ocv_full_count = 0;
|
|
ocv_full_count = 0;
|