Parcourir la source

Merge remote-tracking branch 'origin/master' into dev

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui il y a 3 ans
Parent
commit
1de06f1726
2 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 1 1
      Application/app/sox/health.c
  2. 2 1
      Application/app/sox/soc.c

+ 1 - 1
Application/app/sox/health.c

@@ -202,7 +202,7 @@ void check_current_state(void){
 
 /* 检测pack电压,cell电压,pack电压过低触发powerdown*/
 static debounce_t _discharger_lower_voltage = {.count = 0, .max_count = 200, .init_count = 0};
-static debounce_t _power_down_voltage = {.count = 0, .max_count = 400, .init_count = 0};
+static debounce_t _power_down_voltage = {.count = 0, .max_count = 200, .init_count = 0};
 static debounce_t _sigle_cell_discharger_lower_vol = {.count = 0, .max_count = 200, .init_count = 0};
 static debounce_t _sigle_cell_charger_max_vol = {.count = 0, .max_count = 200, .init_count = 0};
 static debounce_t _shut_discharger_lower_voltage = {.count = 0, .max_count = 20,.init_count = 0};

+ 2 - 1
Application/app/sox/soc.c

@@ -491,6 +491,7 @@ static void soc_update_by_current_and_time(float current_now, float delta_time,
 	double delta_q = current * delta_time; 
 	uint8_t est_capaticy = _soc.capacity;
 	int update_capticy = 0;
+	uint8_t prev_cap = _soc.capacity;
 
 	if (!chargering) {
 		soc_update_discharger_coeff();
@@ -535,7 +536,7 @@ static void soc_update_by_current_and_time(float current_now, float delta_time,
 	soc_calibrate(prev_charge_status);
 
 	//如果没有校准过,充电过程中,电量100%后,设置校准标志位
-	if (chargering && (_soc.capacity == 100)){
+	if ((_soc.capacity == 100) && (prev_cap < 100)){
 		if ((_soc.flags & SOC_FLAG_CALIBRATED) == 0){
 			_soc.flags |= SOC_FLAG_CALIBRATED;
 			update_capticy = 1;