Explorar o código

加入统计温度移除的次数

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui %!s(int64=4) %!d(string=hai) anos
pai
achega
ca37da40b4
Modificáronse 2 ficheiros con 9 adicións e 0 borrados
  1. 5 0
      Application/app/sox/health.c
  2. 4 0
      Application/app/sox/health.h

+ 5 - 0
Application/app/sox/health.c

@@ -81,6 +81,7 @@ void health_log(void){
 	health_debug("aux_short: %d, %d\n", error_counts.aux_short, error_counts.aux_real_short);
 	health_debug("lower voltage: %d, %d, %d, %d\n", discharger_lower_cell_voltage, discharger_lower_voltage, error_counts.cell_under_voltage, error_counts.pack_under_voltage);
 	health_debug("uart error %d, %d, %d\n", error_counts.uart_crc_error, error_counts.uart_len_error, error_counts.uart_dir_error);
+	health_debug("Temp abnormal: %d,%d,%d,%d\n", error_counts.discharger_high_temp, error_counts.charger_high_temp, error_counts.discharger_lower_temp, error_counts.charger_lower_temp);
 }
 
 bms_health_t *bms_health(){
@@ -423,6 +424,7 @@ void check_temp_state(void){
 		}
 		if (debounce_reach_max(_charger_over_temp_count)){
 			_health.over_temp_deny_charger = 1;
+			error_counts.charger_high_temp ++;
 			debounce_reset(_charger_over_temp_count);
 		}			
 	}
@@ -434,6 +436,7 @@ void check_temp_state(void){
 		}
 		if (debounce_reach_max(_charger_lower_temp_count)) {
 			_health.lower_temp_deny_charger = 1;
+			error_counts.charger_lower_temp ++;
 			debounce_reset(_charger_lower_temp_count);
 		}
 	}
@@ -458,6 +461,7 @@ void check_temp_state(void){
 		}
 		if (debounce_reach_max(_discharger_over_temp_count)){
 			_health.over_temp_deny_discharger = 1;
+			error_counts.discharger_high_temp ++;
 			debounce_reset(_discharger_over_temp_count);
 		}			
 	}
@@ -470,6 +474,7 @@ void check_temp_state(void){
 		}
 		if (debounce_reach_max(_discharger_lower_temp_count)) {
 			_health.lower_temp_deny_discharger = 1;
+			error_counts.discharger_lower_temp ++;
 			debounce_reset(_discharger_lower_temp_count);
 		}
 	}

+ 4 - 0
Application/app/sox/health.h

@@ -58,6 +58,10 @@ typedef struct {
 	uint32_t aux_real_short;
 	uint32_t cell_under_voltage;
 	uint32_t pack_under_voltage;
+	uint32_t discharger_high_temp;
+	uint32_t discharger_lower_temp;
+	uint32_t charger_high_temp;
+	uint32_t charger_lower_temp;
 	uint32_t uart_crc_error;
 	uint32_t uart_len_error;
 	uint32_t uart_dir_error;