Sfoglia il codice sorgente

不改变原来的health

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 5 anni fa
parent
commit
f1c55c7fe2
2 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 2 1
      Application/app/bms_message.c
  2. 1 1
      Application/app/sox/health.h

+ 2 - 1
Application/app/bms_message.c

@@ -78,8 +78,9 @@ void process_bms_message(can_frame_t *frame, int len){
 					bresp.max_temp = measure_value()->pack_temp[i];
 				}
 			}
-			bms_health()->is_calibrated = (get_soc()->flags & SOC_FLAG_CALIBRATED) != 0;
 			bresp.health = *((uint32_t *)bms_health());
+			bresp.health &= ~(1 << 8);
+			bresp.health |= ((get_soc()->flags & SOC_FLAG_CALIBRATED) != 0) << 8;
 			stat_cmd_resp_t sresp;
 			sresp.insert = bms_insert;
 			sresp.is_charging = bms_state_get()->charging;

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

@@ -24,7 +24,7 @@ typedef struct {
 	uint32_t charger_over_current:1;
 	uint32_t discharger_over_current:1;
 
-	uint32_t is_calibrated :1;//ST_TOTAL_CHRG
+	uint32_t res1 :1;//ST_TOTAL_CHRG
 	uint32_t charger_cells_vol_diff_over:1; //充电cell的电压差异超过阈值
 	uint32_t power_save:1;
 	uint32_t powerdown_lower_voltage:1;