|
@@ -1,6 +1,5 @@
|
|
|
|
|
|
#include "BCU.h"
|
|
|
-
|
|
|
static StaticTask_t gProcess_Bcu_Task_t;
|
|
|
static UINT8 gProcess_Bcu_TaskStack[PROC_BCU_TASK_STACK_SIZE];
|
|
|
static osThreadId_t BcuTaskId = NULL;
|
|
@@ -92,7 +91,7 @@ void BCU(void)
|
|
|
}
|
|
|
// printf("time:%d\n",ihd_tm_parkTime);
|
|
|
//
|
|
|
-
|
|
|
+
|
|
|
//数据获取
|
|
|
ihd_st_reSet = SysResetFlag;
|
|
|
ihd_I_curr = (int16_T)(-(battI - 10000));
|
|
@@ -113,26 +112,26 @@ void BCU(void)
|
|
|
ihd_flg_urtRecFlt = UartErrorFlag;
|
|
|
ihd_flg_urtRecFlg = UartRecvFlag;
|
|
|
ihd_st_chrgConnect = chargerConnectState;
|
|
|
- ihd_flg_cellULowFlt = ((battWarningState)&0x01) == 1;
|
|
|
- ihd_flg_battULowFlt = ((battWarningState >> 1) & 0x01) == 1;
|
|
|
- ihd_flg_cellUOverFlt = ((battWarningState >> 2) & 0x01) == 1;
|
|
|
- ihd_flg_battUOverFlt = ((battWarningState >> 3) & 0x01) == 1;
|
|
|
- ihd_flg_disChrgCurrOverFlt = ((battWarningState >> 4) & 0x01) == 1;
|
|
|
- ihd_flg_chrgCurrOverFlt = ((battWarningState >> 5) & 0x01) == 1;
|
|
|
- ihd_flg_disChrgModTOverFlt = ((battWarningState >> 6) & 0x01) == 1;
|
|
|
- ihd_flg_chrgModTOverFlt = ((battWarningState >> 7) & 0x01) == 1;
|
|
|
- ihd_flg_chrgMosTOverFlt = ((battWarningState >> 11) & 0x01) == 1;
|
|
|
+ ihd_flg_cellULowFlt = (getbit(battProtectState, 8)) == 1;
|
|
|
+ ihd_flg_battULowFlt = (getbit(battProtectState, 9)) == 1;
|
|
|
+ ihd_flg_cellUOverFlt = (getbit(battProtectState, 24)) == 1;
|
|
|
+ ihd_flg_battUOverFlt = (getbit(battProtectState, 25)) == 1;
|
|
|
+ ihd_flg_disChrgCurrOverFlt = (getbit(battProtectState, 1)) == 1;
|
|
|
+ ihd_flg_chrgCurrOverFlt = (getbit(battProtectState, 2)) == 1;
|
|
|
+ ihd_flg_disChrgModTOverFlt = (getbit(battProtectState, 20)) == 1;
|
|
|
+ ihd_flg_chrgModTOverFlt = (getbit(battProtectState, 16)) == 1;
|
|
|
+ ihd_flg_chrgMosTOverFlt = (getbit(battProtectState, 18)) == 1;
|
|
|
ihd_flg_disChrgMosClosFlt = ((battWarningState >> 18) & 0x01) == 1;
|
|
|
ihd_flg_chrgMosClosFlt = ((battWarningState >> 19) & 0x01) == 1;
|
|
|
- ihd_flg_disChrgModTLowFlt = ((battWarningState >> 22) & 0x01) == 1;
|
|
|
- ihd_flg_chrgModTLowFlt = ((battWarningState >> 23) & 0x01) == 1;
|
|
|
+ ihd_flg_disChrgModTLowFlt = (getbit(battProtectState, 21)) == 1;
|
|
|
+ ihd_flg_chrgModTLowFlt = (getbit(battProtectState, 17)) == 1;
|
|
|
ihd_flg_currOpenFlt = 0;
|
|
|
ihd_st_heatForceControl = HeatForceControl;
|
|
|
ihd_st_chrgMosControl = ChargeForbiddenControl == 0;
|
|
|
ihd_st_disChrgMosControl = DisChargeForbiddenControl == 0;
|
|
|
ihd_st_relayControl = RelayForbiddenControl == 0;
|
|
|
- ihd_st_heatStat = battHeatEnableState;
|
|
|
- // ihd_flg_DTCClear = 1; //////clear
|
|
|
+ ihd_st_heatStat = battHeatEnableState;
|
|
|
+ ihd_flg_DTCClear = 1; //////clear
|
|
|
//调用算法
|
|
|
SFM();
|
|
|
TMS();
|
|
@@ -174,7 +173,7 @@ void BCU(void)
|
|
|
if (TimeCounter % 10 == 0)
|
|
|
{
|
|
|
ihd_tm_parkTime++;
|
|
|
- //printf("time:%d\n",ihd_tm_parkTime);
|
|
|
+ // printf("time:%d\n",ihd_tm_parkTime);
|
|
|
}
|
|
|
if (TimeCounter % 1000 == 0)
|
|
|
{
|