Просмотр исходного кода

update soc state

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 5 лет назад
Родитель
Сommit
30e02241a6

+ 20 - 14
Application/app/sox/health.c

@@ -33,9 +33,9 @@ static float min_discharger_power_recovery_cell_vol[] = {2200, 2600}; //
 
 
 /*能提供大电的最小电压*/
 /*能提供大电的最小电压*/
 static float min_discharger_vol[] = {30000, 36000};//允许能放电的最小电压
 static float min_discharger_vol[] = {30000, 36000};//允许能放电的最小电压
-static float min_discharger_recovery_vol[] = {32000, 38000};//恢复放电的最小电压
-static float min_discharger_cell_vol[] = {2000, 2400};//允许能放电的最小电芯电压
-static float min_discharger_cell_recovery_vol[] = {2100, 2500};//恢复放电的最小电芯电压
+static float min_discharger_recovery_vol[] = {32000, 40000};//恢复放电的最小电压
+static float min_discharger_cell_vol[] = {2000, 2500};//允许能放电的最小电芯电压
+static float min_discharger_cell_recovery_vol[] = {2100, 2600};//恢复放电的最小电芯电压
 
 
 /*电池PowerDown的最小电压 */
 /*电池PowerDown的最小电压 */
 static float min_discharger_pdown_vol[] = {28000, 34000}; //power down的最小电压
 static float min_discharger_pdown_vol[] = {28000, 34000}; //power down的最小电压
@@ -59,7 +59,7 @@ void health_init(void){
 	for (int i = 0; i < CELLS_NUM; i++){
 	for (int i = 0; i < CELLS_NUM; i++){
 		_health.internal_resistance[i] = 5;//毫欧,暂时用一个固定数据,后期需要计算R0=(U2-U1)/(I1-I2) - R1(R1为电路上的等效电阻+采样电阻)
 		_health.internal_resistance[i] = 5;//毫欧,暂时用一个固定数据,后期需要计算R0=(U2-U1)/(I1-I2) - R1(R1为电路上的等效电阻+采样电阻)
 	}
 	}
-	_health.is_work_temp_lower = 0;
+	_health.is_work_temp_normal = 1;
 }
 }
 
 
 bms_health_t *bms_health(){
 bms_health_t *bms_health(){
@@ -179,8 +179,8 @@ static int _can_powerdown(void){
 	if (io_state()->charger_detect || bms_state_get()->charging){
 	if (io_state()->charger_detect || bms_state_get()->charging){
 		return 0;
 		return 0;
 	}
 	}
-	if ((bms_state_get()->pack_voltage <= min_discharger_pdown_vol[_health.is_work_temp_lower] ||
-			bms_state_get()->cell_min_vol <= min_discharger_pdown_cell_vol[_health.is_work_temp_lower])){
+	if ((bms_state_get()->pack_voltage <= min_discharger_pdown_vol[_health.is_work_temp_normal] ||
+			bms_state_get()->cell_min_vol <= min_discharger_pdown_cell_vol[_health.is_work_temp_normal])){
 		return 1;
 		return 1;
 	}
 	}
 	return 0;
 	return 0;
@@ -207,40 +207,40 @@ void check_voltage_state(void) {
 		//check sigle cell's voltage for discharger
 		//check sigle cell's voltage for discharger
 		_health.charger_over_voltage = _health.sigle_cell_over_voltage = 0;
 		_health.charger_over_voltage = _health.sigle_cell_over_voltage = 0;
 		
 		
-		if ((bms_state_get()->cell_min_vol <= min_discharger_cell_vol[_health.is_work_temp_lower])){
+		if ((bms_state_get()->cell_min_vol <= min_discharger_cell_vol[_health.is_work_temp_normal])){
 			if (judge_debounce(!_health.sigle_cell_lower_voltage, &_sigle_cell_discharger_lower_vol)){
 			if (judge_debounce(!_health.sigle_cell_lower_voltage, &_sigle_cell_discharger_lower_vol)){
 				_health.sigle_cell_lower_voltage = 1;
 				_health.sigle_cell_lower_voltage = 1;
 			}
 			}
-		}else if ((bms_state_get()->cell_min_vol >= min_discharger_cell_recovery_vol[_health.is_work_temp_lower])){
+		}else if ((bms_state_get()->cell_min_vol >= min_discharger_cell_recovery_vol[_health.is_work_temp_normal])){
 			if (judge_debounce(_health.sigle_cell_lower_voltage, &_sigle_cell_discharger_lower_vol)){
 			if (judge_debounce(_health.sigle_cell_lower_voltage, &_sigle_cell_discharger_lower_vol)){
 				_health.sigle_cell_lower_voltage = 0;
 				_health.sigle_cell_lower_voltage = 0;
 			}
 			}
 		}
 		}
 		//check sigle pack's voltage for discharger
 		//check sigle pack's voltage for discharger
-		if (bms_state_get()->pack_voltage <= min_discharger_vol[_health.is_work_temp_lower]){
+		if (bms_state_get()->pack_voltage <= min_discharger_vol[_health.is_work_temp_normal]){
 			if (judge_debounce(!_health.discharger_lower_voltage, &_discharger_lower_voltage)){
 			if (judge_debounce(!_health.discharger_lower_voltage, &_discharger_lower_voltage)){
 				_health.discharger_lower_voltage = 1;
 				_health.discharger_lower_voltage = 1;
 			}
 			}
-		}else if (bms_state_get()->pack_voltage >= min_discharger_recovery_vol[_health.is_work_temp_lower]){
+		}else if (bms_state_get()->pack_voltage >= min_discharger_recovery_vol[_health.is_work_temp_normal]){
 			if (judge_debounce(_health.discharger_lower_voltage, &_discharger_lower_voltage)){
 			if (judge_debounce(_health.discharger_lower_voltage, &_discharger_lower_voltage)){
 				_health.discharger_lower_voltage = 0;
 				_health.discharger_lower_voltage = 0;
 			}
 			}
 		}
 		}
 		//check for shutdown power
 		//check for shutdown power
-		if ((bms_state_get()->cell_min_vol <= min_discharger_power_cell_vol[_health.is_work_temp_lower])){
+		if ((bms_state_get()->cell_min_vol <= min_discharger_power_cell_vol[_health.is_work_temp_normal])){
 			if (judge_debounce(!_health.discharger_cell_shutpower_voltage, &_shut_discharger_cell_lower_voltage)){
 			if (judge_debounce(!_health.discharger_cell_shutpower_voltage, &_shut_discharger_cell_lower_voltage)){
 				_health.discharger_cell_shutpower_voltage = 1;
 				_health.discharger_cell_shutpower_voltage = 1;
 			}
 			}
-		}else if ((bms_state_get()->cell_min_vol >= min_discharger_power_recovery_cell_vol[_health.is_work_temp_lower])){
+		}else if ((bms_state_get()->cell_min_vol >= min_discharger_power_recovery_cell_vol[_health.is_work_temp_normal])){
 			if (judge_debounce(_health.discharger_cell_shutpower_voltage, &_shut_discharger_cell_lower_voltage)){
 			if (judge_debounce(_health.discharger_cell_shutpower_voltage, &_shut_discharger_cell_lower_voltage)){
 				_health.discharger_cell_shutpower_voltage = 0;
 				_health.discharger_cell_shutpower_voltage = 0;
 			}
 			}
 		}
 		}
-		if ((bms_state_get()->cell_min_vol <= min_discharger_power_vol[_health.is_work_temp_lower])){
+		if ((bms_state_get()->cell_min_vol <= min_discharger_power_vol[_health.is_work_temp_normal])){
 			if (judge_debounce(!_health.discharger_cell_shutpower_voltage, &_shut_discharger_lower_voltage)){
 			if (judge_debounce(!_health.discharger_cell_shutpower_voltage, &_shut_discharger_lower_voltage)){
 				_health.discharger_shutpower_voltage = 1;
 				_health.discharger_shutpower_voltage = 1;
 			}
 			}
-		}else if ((bms_state_get()->cell_min_vol >= min_discharger_power_recovery_vol[_health.is_work_temp_lower])){
+		}else if ((bms_state_get()->cell_min_vol >= min_discharger_power_recovery_vol[_health.is_work_temp_normal])){
 			if (judge_debounce(_health.discharger_cell_shutpower_voltage, &_shut_discharger_lower_voltage)){
 			if (judge_debounce(_health.discharger_cell_shutpower_voltage, &_shut_discharger_lower_voltage)){
 				_health.discharger_shutpower_voltage = 0;
 				_health.discharger_shutpower_voltage = 0;
 			}
 			}
@@ -320,6 +320,12 @@ static void _aux_unlock_timer_handler(shark_timer_t *t){
 }
 }
 
 
 
 
+void health_stop_aux_detect(void){
+	shark_timer_cancel(&_aux_unlock_timer);
+	shark_timer_cancel(&_aux_lock_timer);
+	bms_health()->small_current_short = 0;
+}
+
 void health_process_aux_lock(void){
 void health_process_aux_lock(void){
 	if (io_state()->aux_lock_detect) {
 	if (io_state()->aux_lock_detect) {
 		if (AUX_VOL_IS_OPEN()){
 		if (AUX_VOL_IS_OPEN()){

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

@@ -36,7 +36,7 @@ typedef struct {
 	uint32_t discharger_shutpower_voltage:1; //¹Ø±Õ¶¯Á¦
 	uint32_t discharger_shutpower_voltage:1; //¹Ø±Õ¶¯Á¦
 	uint32_t discharger_cell_shutpower_voltage:1; //¹Ø±Õ¶¯Á¦
 	uint32_t discharger_cell_shutpower_voltage:1; //¹Ø±Õ¶¯Á¦
 	
 	
-	uint32_t is_work_temp_lower:1;
+	uint32_t is_work_temp_normal:1;
 
 
 	uint32_t lower_temp_deny_charger:1;
 	uint32_t lower_temp_deny_charger:1;
 	uint32_t lower_temp_deny_discharger:1;
 	uint32_t lower_temp_deny_discharger:1;
@@ -54,6 +54,7 @@ void check_current_state(void);
 void check_voltage_state(void);
 void check_voltage_state(void);
 void check_temp_state(void);
 void check_temp_state(void);
 void health_process_aux_lock(void);
 void health_process_aux_lock(void);
+void health_stop_aux_detect(void);
 
 
 #endif /* _HEALTH_H__ */
 #endif /* _HEALTH_H__ */
 
 

+ 10 - 1
Application/app/sox/iostate.c

@@ -48,7 +48,8 @@ void io_state_init(void){
 	shark_timer_post(&dcdc_pwr_io._timer, io_detect_intv_time);
 	shark_timer_post(&dcdc_pwr_io._timer, io_detect_intv_time);
 
 
 	small_current_short_irq_enable(1);
 	small_current_short_irq_enable(1);
-
+	charger_detect_irq_enable(1);
+	
 	bms_message_update_insert(_io_state.hall_detect);
 	bms_message_update_insert(_io_state.hall_detect);
 
 
 	iostate_log();
 	iostate_log();
@@ -140,6 +141,9 @@ static void io_timer_handler(shark_timer_t *t){
 	}
 	}
 }
 }
 
 
+static void charger_detect_irq_timer_handler(shark_timer_t *t){
+	_io_state.charger_detect_irq = 0;
+}
 
 
 static void small_current_irq_timer_handler(shark_timer_t *t){
 static void small_current_irq_timer_handler(shark_timer_t *t){
 	aux_short_io.value = _io_state.aux_lock_detect = IS_AUX_VOL_LOCKED() && AUX_VOL_IS_OPEN();
 	aux_short_io.value = _io_state.aux_lock_detect = IS_AUX_VOL_LOCKED() && AUX_VOL_IS_OPEN();
@@ -147,6 +151,8 @@ static void small_current_irq_timer_handler(shark_timer_t *t){
 	health_process_aux_lock();
 	health_process_aux_lock();
 }
 }
 static shark_timer_t _small_current_irq_timer = {.handler = small_current_irq_timer_handler};
 static shark_timer_t _small_current_irq_timer = {.handler = small_current_irq_timer_handler};
+static shark_timer_t _charger_detect_irq_timer = {.handler = charger_detect_irq_timer_handler};
+
 void small_current_short_irq_handler(void){
 void small_current_short_irq_handler(void){
 	if (!AUX_VOL_IS_OPEN()){
 	if (!AUX_VOL_IS_OPEN()){
 		io_debug("close aux power,cause the short irq\n");
 		io_debug("close aux power,cause the short irq\n");
@@ -159,7 +165,10 @@ void small_current_short_irq_handler(void){
 
 
 void charger_detect_irq_handler(void){
 void charger_detect_irq_handler(void){
 	mcu_sleep_set_wakeup_source(WAKEUP_SOURCE_CHARGER);
 	mcu_sleep_set_wakeup_source(WAKEUP_SOURCE_CHARGER);
+	_io_state.charger_detect_irq = 1;
+	shark_timer_post(&_charger_detect_irq_timer, 2000);//延时2s给充电判断充足的时间
 }
 }
+
 void hall1_detect_irq_handler(void){
 void hall1_detect_irq_handler(void){
 
 
 	mcu_sleep_set_wakeup_source(WAKEUP_SOURCE_HALL1);
 	mcu_sleep_set_wakeup_source(WAKEUP_SOURCE_HALL1);

+ 1 - 0
Application/app/sox/iostate.h

@@ -7,6 +7,7 @@ typedef struct{
 	uint16_t aux_lock_detect:1;
 	uint16_t aux_lock_detect:1;
 	uint16_t pwr_good_detect:1;
 	uint16_t pwr_good_detect:1;
 	uint16_t dcdc_good_detect:1;
 	uint16_t dcdc_good_detect:1;
+	uint16_t charger_detect_irq:1;
 }io_state_t;
 }io_state_t;
 
 
 void io_state_init(void);
 void io_state_init(void);

+ 10 - 4
Application/app/sox/soc.c

@@ -94,6 +94,7 @@ static __inline__ float _delta_time(void){
 }
 }
 
 
 void soc_update_by_ocv(void){
 void soc_update_by_ocv(void){
+	static int cali_full_count = 0;
 	if (_soc.flags & SOC_FLAG_CALIBRATED){
 	if (_soc.flags & SOC_FLAG_CALIBRATED){
 		if (!chargering && bms_health()->powerdown_lower_voltage){
 		if (!chargering && bms_health()->powerdown_lower_voltage){
 			_soc.coulomb_min = _soc.coulomb_now; //已经校准过了,而且电池进入powerdown,最小容量修正为当前容量
 			_soc.coulomb_min = _soc.coulomb_now; //已经校准过了,而且电池进入powerdown,最小容量修正为当前容量
@@ -108,14 +109,19 @@ void soc_update_by_ocv(void){
 		}
 		}
 	}else {
 	}else {
 		if (chargering){//用ocv进行严格校准
 		if (chargering){//用ocv进行严格校准
-			if (measure_value()->load_current <= 300.0f){				
+			if (measure_value()->load_current <= 400.0f){				
 				//判断总电压
 				//判断总电压
-				if (bms_state_get()->pack_voltage >= 54000){
-					soc_debug("measure_value()->load_current %d\n", measure_value()->load_current);
-					_soc.capacity = 100;
+				if (bms_state_get()->pack_voltage >= 53000){
+					cali_full_count ++;
+					if (cali_full_count == 10) {
+						soc_debug("measure_value()->load_current %d\n", measure_value()->load_current);
+						_soc.capacity = 100;
+					}
+					return;
 				}
 				}
 			}
 			}
 		}
 		}
+		cali_full_count = 0;
 	}
 	}
 }
 }
 
 

+ 46 - 26
Application/app/sox/state.c

@@ -79,6 +79,7 @@ int bms_work_mode_set(int mode, int start){
 }
 }
 
 
 void bms_state_log(void){
 void bms_state_log(void){
+	state_warning("Life Time: %d\n", shark_get_seconds());
 	state_debug("Charging: %d\n", _bms_state.charging);
 	state_debug("Charging: %d\n", _bms_state.charging);
 	state_debug("WorkMode %d\n", _bms_state.work_mode);
 	state_debug("WorkMode %d\n", _bms_state.work_mode);
 	state_debug("DMos: %d\n", ml5238_is_discharging());
 	state_debug("DMos: %d\n", ml5238_is_discharging());
@@ -129,17 +130,26 @@ static void charger_open(int open) {
 }
 }
 
 
 
 
+void start_aux_power(int start){
+	if (start){
+		AUX_VOL_OPEN(1);
+	}else {
+		AUX_VOL_OPEN(0);
+		health_stop_aux_detect();
+	}
+}
+
 #define Health_Success 0
 #define Health_Success 0
 #define Health_Discharger_Failt 1
 #define Health_Discharger_Failt 1
 #define Health_charger_Fault 2
 #define Health_charger_Fault 2
 #define Health_aux_Fault 4
 #define Health_aux_Fault 4
-
+#define Health_Fault_Can_Sleep 8
 static s32 _process_unheath(void){
 static s32 _process_unheath(void){
 	u32 unhealth = Health_Success;
 	u32 unhealth = Health_Success;
 	if (bms_health()->load_current_short) {//短路检测后,关闭充放电mos
 	if (bms_health()->load_current_short) {//短路检测后,关闭充放电mos
 		discharger_open(0);
 		discharger_open(0);
 		charger_open(0); //disable charger mosfet
 		charger_open(0); //disable charger mosfet
-		AUX_VOL_OPEN(0);
+		start_aux_power(0);
 		_bms_state.charging = 0;
 		_bms_state.charging = 0;
 		unhealth = (Health_Discharger_Failt | Health_charger_Fault);
 		unhealth = (Health_Discharger_Failt | Health_charger_Fault);
 	}
 	}
@@ -152,12 +162,16 @@ static s32 _process_unheath(void){
 	}
 	}
 
 
 	if (bms_health()->discharger_over_temp || bms_health()->discharger_lower_temp || bms_health()->discharger_lower_voltage ||
 	if (bms_health()->discharger_over_temp || bms_health()->discharger_lower_temp || bms_health()->discharger_lower_voltage ||
-				bms_health()->over_temp_deny_discharger|| bms_health()->lower_temp_deny_discharger){
+				bms_health()->over_temp_deny_discharger|| bms_health()->lower_temp_deny_discharger || bms_health()->sigle_cell_lower_voltage){
+		if (bms_health()->discharger_over_temp || bms_health()->sigle_cell_lower_voltage || bms_health()->discharger_lower_voltage){ //放电过高温后,小电流也必须关闭
+			start_aux_power(0);
+			unhealth |= Health_aux_Fault;
+		}
 		discharger_open(0); //disable charger mosfet
 		discharger_open(0); //disable charger mosfet
 		unhealth |= Health_Discharger_Failt;
 		unhealth |= Health_Discharger_Failt;
-		if (bms_health()->discharger_over_temp){ //放电过高温后,小电流也必须关闭
-			AUX_VOL_OPEN(0);
-			unhealth |= Health_aux_Fault;
+		if (bms_health()->sigle_cell_lower_voltage || bms_health()->discharger_lower_voltage ||
+			bms_health()->over_temp_deny_discharger || bms_health()->lower_temp_deny_discharger) {
+			unhealth |= Health_Fault_Can_Sleep;
 		}
 		}
 	}
 	}
 
 
@@ -172,27 +186,30 @@ static s32 _process_unheath(void){
 //处理PS100/310/320/360,充电底座,充电柜的指令或者bms自己发给自己的指令
 //处理PS100/310/320/360,充电底座,充电柜的指令或者bms自己发给自己的指令
 static void _process_user_request(s32 health){
 static void _process_user_request(s32 health){
 	if (_bms_state.user_request & USER_REQUEST_PENDING){
 	if (_bms_state.user_request & USER_REQUEST_PENDING){
-		if ((health & Health_charger_Fault) == 0){
-			if (_bms_state.user_request & USER_REQUEST_CHARGER_ON){
-				charger_open(1);
-			}else if (_bms_state.user_request & USER_REQUEST_CHARGER_OFF){
-				charger_open(0);
+		//开关小电
+		if (_bms_state.user_request & USER_REQUEST_SMALLCURRENT_OFF){
+			start_aux_power(0);
+		}else if (_bms_state.user_request & USER_REQUEST_SMALLCURRENT_ON){ 
+			if ((health & Health_aux_Fault) == 0){
+				AUX_VOL_OPEN(1);
 			}
 			}
 		}
 		}
-		if ((health & Health_Discharger_Failt) == 0){
-			if (_bms_state.user_request & USER_REQUEST_DISCHARGER_ON){
-				discharger_open(1);
-			}else if (_bms_state.user_request & USER_REQUEST_DISCHARGER_OFF){
-				discharger_open(0);
+		//开关放电
+		if (_bms_state.user_request & USER_REQUEST_CHARGER_OFF){
+			charger_open(0);
+		}else if (_bms_state.user_request & USER_REQUEST_CHARGER_ON){
+			if ((health & Health_charger_Fault) == 0){
+				charger_open(1);
 			}
 			}
 		}
 		}
-		if ((health & Health_aux_Fault) == 0){
-			if (_bms_state.user_request & USER_REQUEST_SMALLCURRENT_ON){
-				AUX_VOL_OPEN(1);
-			}else if (_bms_state.user_request & USER_REQUEST_SMALLCURRENT_OFF){
-				AUX_VOL_OPEN(0);
+		//开关充电
+		if (_bms_state.user_request & USER_REQUEST_DISCHARGER_OFF){
+			discharger_open(0);
+		}else if (_bms_state.user_request & USER_REQUEST_DISCHARGER_ON) {
+			if ((health & Health_Discharger_Failt) == 0){
+				discharger_open(1);
 			}
 			}
-		}	
+		} 
 		_bms_state.user_request &= ~USER_REQUEST_PENDING;//clear user request pending
 		_bms_state.user_request &= ~USER_REQUEST_PENDING;//clear user request pending
 	}
 	}
 }
 }
@@ -215,7 +232,7 @@ static void _process_power_down(void){
 			return;
 			return;
 		}
 		}
 		ml5238_enable_charger_detect(AUX_VOL_IS_OPEN(), 0);
 		ml5238_enable_charger_detect(AUX_VOL_IS_OPEN(), 0);
-		AUX_VOL_OPEN(0);
+		start_aux_power(0);
 		discharger_open(0);
 		discharger_open(0);
 		charger_open(0);
 		charger_open(0);
 		
 		
@@ -245,11 +262,11 @@ static void _process_deepsleep(s32 health){
 #if (ALLOW_DEEP_SLEEP==1)
 #if (ALLOW_DEEP_SLEEP==1)
 	static u64 _sleep_time = 0;
 	static u64 _sleep_time = 0;
 #if (SLEEP_IGNORE_UNHEALTH==0)
 #if (SLEEP_IGNORE_UNHEALTH==0)
-	if (health != Health_Success){
+	if ((health & Health_Fault_Can_Sleep) != Health_Fault_Can_Sleep){
 		return;
 		return;
 	}
 	}
 #endif
 #endif
-	if (ml5238_is_charging() || ml5238_is_discharging() || IS_CHARGER_IN()){
+	if (ml5238_is_charging() || ml5238_is_discharging() || io_state()->charger_detect_irq || _bms_state.charging){
 		return;
 		return;
 	}
 	}
 
 
@@ -289,7 +306,10 @@ static void _process_iostate_changed(s32 unhealth){
 			discharger_open(0);
 			discharger_open(0);
 		}
 		}
 		if (!AUX_VOL_IS_OPEN()){
 		if (!AUX_VOL_IS_OPEN()){
-			AUX_VOL_OPEN(1);
+			start_aux_power(1);
+		}
+		if (!io_state()->charger_detect_irq && ml5238_is_charging() && (!_bms_state.charging)){
+			charger_open(0);
 		}
 		}
 	}
 	}
 	if (io_state()->charger_detect && ((unhealth & Health_charger_Fault) == 0) && (_bms_state.cell_max_vol < SIGLE_CELL_MAX_CHARGER_VOLTAGE)) {
 	if (io_state()->charger_detect && ((unhealth & Health_charger_Fault) == 0) && (_bms_state.cell_max_vol < SIGLE_CELL_MAX_CHARGER_VOLTAGE)) {

+ 0 - 2
Application/bsp/mcu_power_sleep.c

@@ -30,7 +30,6 @@ uint32_t get_system_sleep_time(void){
 }
 }
 
 
 static void enable_wakeup_irq(void){
 static void enable_wakeup_irq(void){
-	charger_detect_irq_enable(1);
 	hall_1_detect_irq_enable(1);
 	hall_1_detect_irq_enable(1);
 	hall_2_detect_irq_enable(1);
 	hall_2_detect_irq_enable(1);
 	shark_rtc_start_alarm(RTC_ALARM_FOR_SLEEP);
 	shark_rtc_start_alarm(RTC_ALARM_FOR_SLEEP);
@@ -38,7 +37,6 @@ static void enable_wakeup_irq(void){
 
 
 static void disable_wakeup_irq(void){
 static void disable_wakeup_irq(void){
 	shark_rtc_stop_alarm();
 	shark_rtc_stop_alarm();
-	charger_detect_irq_enable(0);
 	hall_1_detect_irq_enable(0);
 	hall_1_detect_irq_enable(0);
 	hall_2_detect_irq_enable(0);
 	hall_2_detect_irq_enable(0);
 }
 }