|
|
@@ -367,17 +367,23 @@ static int _can_close_mos_no_hall(void){
|
|
|
}
|
|
|
|
|
|
static void _process_iostate_changed(s32 unhealth){
|
|
|
+ static u64 _hall_no_time = 0;
|
|
|
if (!(io_state()->hall_detect)&& _can_close_mos_no_hall()){
|
|
|
- if (ml5238_is_discharging() && (!_bms_state.charging)){
|
|
|
- discharger_open(0);
|
|
|
- }
|
|
|
- if (!AUX_VOL_IS_OPEN()){
|
|
|
- start_aux_power(1);
|
|
|
- }
|
|
|
- if (!io_state()->charger_detect_irq && ml5238_is_charging() && (!_bms_state.charging)){
|
|
|
- charger_open(0);
|
|
|
- }
|
|
|
bms_set_ps_charger_in(0, 0);
|
|
|
+ /* 无hall延时2s关大电,确保仪表等负载快速插拔电池能正常,不闪屏 */
|
|
|
+ if (shark_get_mseconds() - _hall_no_time >= 2 * 1000) {
|
|
|
+ if (ml5238_is_discharging() && (!_bms_state.charging)){
|
|
|
+ discharger_open(0);
|
|
|
+ }
|
|
|
+ if (!AUX_VOL_IS_OPEN()){
|
|
|
+ start_aux_power(1);
|
|
|
+ }
|
|
|
+ if (!io_state()->charger_detect_irq && ml5238_is_charging() && (!_bms_state.charging)){
|
|
|
+ charger_open(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ _hall_no_time = shark_get_mseconds();
|
|
|
}
|
|
|
if (io_state()->charger_detect_irq && ((unhealth & Health_charger_Fault) == 0) && (_bms_state.cell_max_vol < SIGLE_CELL_MAX_CHARGER_VOLTAGE)) {
|
|
|
if (!ml5238_is_charging() && shark_uart_timeout()){//不在车上,底座上,充电柜上,检测到充电器插入,自动打开充电,否则的话,只能通过指令来打开充电mos
|