|
|
@@ -93,18 +93,20 @@ static __inline__ float _delta_time(void){
|
|
|
return soc_delta_time; //秒
|
|
|
}
|
|
|
|
|
|
-void soc_update_by_ocv(void){
|
|
|
+int soc_update_by_ocv(void){
|
|
|
static int cali_full_count = 0;
|
|
|
+ int changed = 0;
|
|
|
if (_soc.flags & SOC_FLAG_CALIBRATED){
|
|
|
if (!chargering && bms_health()->powerdown_lower_voltage){
|
|
|
_soc.coulomb_min = _soc.coulomb_now; //已经校准过了,而且电池进入powerdown,最小容量修正为当前容量
|
|
|
_soc.capacity = 0;
|
|
|
soc_warning("current coulomb %f\n", _soc.coulomb_now);
|
|
|
- return;
|
|
|
+ changed = 1;
|
|
|
}
|
|
|
if (chargering){
|
|
|
if (bms_state_get()->pack_voltage >= (54000)){
|
|
|
_soc.capacity = 100;
|
|
|
+ changed = 1;
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
@@ -116,13 +118,15 @@ void soc_update_by_ocv(void){
|
|
|
if (cali_full_count == 10) {
|
|
|
soc_debug("measure_value()->load_current %d\n", measure_value()->load_current);
|
|
|
_soc.capacity = 100;
|
|
|
+ changed = 1;
|
|
|
}
|
|
|
- return;
|
|
|
+ return changed;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
cali_full_count = 0;
|
|
|
}
|
|
|
+ return changed;
|
|
|
}
|
|
|
|
|
|
static void soc_update_charger_remain_time(void){
|