Эх сурвалжийг харах

fix: 充放电mos同开的时间判断修复

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 4 жил өмнө
parent
commit
12cfa531e2

+ 3 - 0
Application/app/sox/state.c

@@ -580,9 +580,11 @@ static void _check_mos_stat(void){
 			int cmos = ml5238_is_charging();
 			if (dmos + cmos == 0){
 				//state_error("current = %d, but all mos is closed\n", measure_value()->load_current);
+				_check_mos_time = shark_get_seconds();
 				return;
 			}
 			if (dmos == 1 && cmos == 1){
+				_check_mos_time = shark_get_seconds();
 				return;
 			}
 			if (shark_get_seconds() >= (_check_mos_time + _open_all_mos_time())) {
@@ -598,6 +600,7 @@ static void _check_mos_stat(void){
 		}
 	}else {
 		_min_current_for_both_mos_count = 0;
+		_check_mos_time = shark_get_seconds();
 	}
 }