Explorar o código

fix health struct defint error

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui %!s(int64=5) %!d(string=hai) anos
pai
achega
2896a410f0

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

@@ -317,7 +317,7 @@ void check_temp_state(void){
 			}			
 		}
 		if (!_health.discharger_lower_temp){
-			if (_is_over_temp(discharger_lower_low_temp)) {//超过允许的最高温度
+			if (_is_low_temp(discharger_lower_low_temp)) {//低于允许的最低温度
 				debounce_inc(_discharger_lower_temp);
 			}else {
 				debounce_reset(_discharger_lower_temp);

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

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

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

@@ -12,7 +12,7 @@
 #include "state.h"
 #include "iostate.h"
 
-#define ALLOW_DEEP_SLEEP 1
+#define ALLOW_DEEP_SLEEP 0
 #define SLEEP_IGNORE_UNHEALTH 1
 #define ALLOW_POWER_DOWN 0 //disable power down for debug
 #define ALLOW_5238_BALANCE 1
@@ -156,9 +156,10 @@ static void _process_power_down(void){
 #endif
 }
 
-static u64 _sleep_time = 0;
+
 static void _process_deepsleep(s32 health){
 #if (ALLOW_DEEP_SLEEP==1)
+	static u64 _sleep_time = 0;
 #if (SLEEP_IGNORE_UNHEALTH==0)
 	if (health != Health_Success){
 		return;