|
|
@@ -167,7 +167,7 @@ static __inline__ int can_modify_min_cap(void){
|
|
|
}
|
|
|
|
|
|
int soc_update_by_ocv(void){
|
|
|
-
|
|
|
+ static int ocv_full_count = 0;
|
|
|
int changed = 0;
|
|
|
if (_soc.flags & SOC_FLAG_CALIBRATED){
|
|
|
if (!chargering){
|
|
|
@@ -187,10 +187,13 @@ int soc_update_by_ocv(void){
|
|
|
}
|
|
|
if (chargering && !is_force_full){
|
|
|
if (bms_state_get()->pack_voltage >= (FULL_MAX_VOLTAGE) && (measure_value()->load_current <= FULL_MIN_CURRENT)){
|
|
|
- _soc.capacity = 100;
|
|
|
- is_force_full = 1;
|
|
|
- force_full_ts = shark_get_seconds();
|
|
|
- changed = 1;
|
|
|
+ if (ocv_full_count++ >= 30) {
|
|
|
+ _soc.capacity = 100;
|
|
|
+ is_force_full = 1;
|
|
|
+ force_full_ts = shark_get_seconds();
|
|
|
+ ocv_full_count = 0;
|
|
|
+ changed = 1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|