|
|
@@ -321,21 +321,23 @@ static debounce_t _discharger_normal_temp_count = {.count = 0, .max_count = 8, .
|
|
|
static debounce_t _work_lower_temp_count = {.count = 0, .max_count = 8, .init_count = 0};
|
|
|
|
|
|
static int _is_over_temp(int8_t *temps, int size){
|
|
|
+ int count = 0;
|
|
|
for (int i = 0; i < size; i++){
|
|
|
if (measure_value()->pack_temp[i] >= temps[i]){
|
|
|
- return 1;
|
|
|
+ count ++;
|
|
|
}
|
|
|
}
|
|
|
- return 0;
|
|
|
+ return count;
|
|
|
}
|
|
|
|
|
|
static int _is_low_temp(int8_t *temps, int size){
|
|
|
+ int count = 0;
|
|
|
for (int i = 0; i < size; i++){
|
|
|
if (measure_value()->pack_temp[i] < temps[i]){
|
|
|
- return 1;
|
|
|
+ count ++;
|
|
|
}
|
|
|
}
|
|
|
- return 0;
|
|
|
+ return count;
|
|
|
}
|
|
|
|
|
|
static uint8_t small_power_detect_count = 0;
|
|
|
@@ -465,7 +467,8 @@ void check_temp_state(void){
|
|
|
}
|
|
|
}
|
|
|
if (!_health.is_work_temp_normal){
|
|
|
- if (_is_over_temp(work_lower_temp, sizeof(work_lower_temp))){
|
|
|
+ /* 3个电芯温度都正常才算正常 */
|
|
|
+ if (_is_over_temp(work_lower_temp, sizeof(work_lower_temp)) == sizeof(work_lower_temp)){
|
|
|
debounce_inc(_work_lower_temp_count);
|
|
|
if (debounce_reach_max(_work_lower_temp_count)){
|
|
|
_health.is_work_temp_normal = 1;
|