|
|
@@ -14,7 +14,7 @@
|
|
|
|
|
|
#define ALLOW_DEEP_SLEEP 1
|
|
|
#define SLEEP_IGNORE_UNHEALTH 0
|
|
|
-#define ALLOW_POWER_DOWN 0 //disable power down for debug
|
|
|
+#define ALLOW_POWER_DOWN 1 //disable power down for debug
|
|
|
#define ALLOW_5238_BALANCE 0
|
|
|
|
|
|
static void _current_notify(void);
|
|
|
@@ -224,15 +224,11 @@ static void _process_power_down(void){
|
|
|
|
|
|
nv_save_soc();
|
|
|
|
|
|
- ml5238_enable_charger_detect(AUX_VOL_IS_OPEN(), 1);
|
|
|
- delay_us(2* 1000);
|
|
|
shark_uart_flush();
|
|
|
- if (!ml5238_charger_is_disconnect(AUX_VOL_IS_OPEN())){//have charger, do'nt power down
|
|
|
+ if (io_state()->charger_detect_irq || io_state()->charger_detect){//have charger, do'nt power down
|
|
|
bms_health()->powerdown_lower_voltage = 0;
|
|
|
- ml5238_enable_charger_detect(AUX_VOL_IS_OPEN(), 0);
|
|
|
return;
|
|
|
}
|
|
|
- ml5238_enable_charger_detect(AUX_VOL_IS_OPEN(), 0);
|
|
|
start_aux_power(0);
|
|
|
discharger_open(0);
|
|
|
charger_open(0);
|