|
|
@@ -351,6 +351,7 @@ void Sub_BMS_1_Initial(void)
|
|
|
static shark_battery_exit_t shark_battery_is_normal_raw(SUB_BMS_INFO *info, shark_battery_power_t power)
|
|
|
{
|
|
|
u16 work_status;
|
|
|
+ u16 work_mask;
|
|
|
|
|
|
if (info->define_error != D_BMS_ERROR_NO) {
|
|
|
return SHARK_BATT_EXIT_ERROR;
|
|
|
@@ -360,15 +361,14 @@ static shark_battery_exit_t shark_battery_is_normal_raw(SUB_BMS_INFO *info, shar
|
|
|
return SHARK_BATT_EXIT_ERROR;
|
|
|
}
|
|
|
|
|
|
- work_status = info->packet_common.work_status;
|
|
|
- work_status &= ~(ST_CHRG_CUR | ST_DISCHRG_CUR | ST_OVRDISCHRG_CUR | ST_SMALL_CURRENT_OVER);
|
|
|
-
|
|
|
if (shark_charger_state == SHARK_CHG_INSERT) {
|
|
|
- work_status &= ~(ST_OVRDISCHRG_VOL | ST_PDOWN | ST_UDR_TEMPE_DISCHRG | ST_OVR_TEMPE_DISCHRG);
|
|
|
+ work_mask = BATT_CHARGE_ERRORS;
|
|
|
} else {
|
|
|
- work_status &= ~(ST_OVRCHRG_VOL | ST_OVR_TEMPE_CHRG | ST_UDR_TEMPE_CHRG);
|
|
|
+ work_mask = BATT_DISCHARGE_ERRORS;
|
|
|
}
|
|
|
|
|
|
+ work_status = info->packet_common.work_status & work_mask;
|
|
|
+
|
|
|
if (work_status != 0) {
|
|
|
info->work_error = work_status;
|
|
|
return SHARK_BATT_EXIT_ERROR;
|