|
@@ -95,12 +95,27 @@ void CANNet_RecvMsgCAN0(MCANDrv_infoMsgS_TYPE infoMsgS)
|
|
infoVcuSendMsg.CanID = infoMsgS.infoConfS.infoMsgIDUI;
|
|
infoVcuSendMsg.CanID = infoMsgS.infoConfS.infoMsgIDUI;
|
|
memcpy(infoVcuSendMsg.CanData,infoMsgS.datMsgUBA,8);
|
|
memcpy(infoVcuSendMsg.CanData,infoMsgS.datMsgUBA,8);
|
|
VcuSendFlg = TRUE;
|
|
VcuSendFlg = TRUE;
|
|
|
|
+ if((infoVcuSendMsg.CanID&0x0000FFFF)==0x0000F3D0||(infoVcuSendMsg.CanID&0x0000FFFF)==0x000015F6||(infoVcuSendMsg.CanID&0x0000FFFF)==0x000051ED)
|
|
|
|
+ {
|
|
|
|
+ CANNet_infoMsgTxConfSA[1].infoMsgIDUI = infoVcuSendMsg.CanID;
|
|
|
|
+ infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[1];
|
|
|
|
+ memset(infoMsgS.datMsgUBA, 0x00, 8);
|
|
|
|
+ if((infoVcuSendMsg.CanID==0x1802F3D0)&& 0)
|
|
|
|
+ {
|
|
|
|
+ static uint8 VcuLife = 0;
|
|
|
|
+ uint8 chk = 0;
|
|
|
|
+ VcuLife = (VcuLife+1)>14?0:(VcuLife+1);
|
|
|
|
+ infoVcuSendMsg.CanData[1] = (BattHvCtl<<4)|(VcuLife&0x0F);
|
|
|
|
+ for(uint8 i=1;i<8;i++)
|
|
|
|
+ {
|
|
|
|
+ chk = chk^infoVcuSendMsg.CanData[i];
|
|
|
|
+ }
|
|
|
|
+ infoVcuSendMsg.CanData[0] = chk;
|
|
|
|
+ }
|
|
|
|
+ memcpy(infoMsgS.datMsgUBA,infoVcuSendMsg.CanData,8);
|
|
|
|
+ MCANDrv_SendMsg(infoMsgS);
|
|
|
|
+ }
|
|
|
|
|
|
- CANNet_infoMsgTxConfSA[1].infoMsgIDUI = infoVcuSendMsg.CanID;
|
|
|
|
- infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[1];
|
|
|
|
- memset(infoMsgS.datMsgUBA, 0x00, 8);
|
|
|
|
- memcpy(infoMsgS.datMsgUBA,infoVcuSendMsg.CanData,8);
|
|
|
|
- MCANDrv_SendMsg(infoMsgS);
|
|
|
|
}
|
|
}
|
|
// CAN1接收消息处理函数
|
|
// CAN1接收消息处理函数
|
|
void CANNet_RecvMsgCAN1(MCANDrv_infoMsgS_TYPE infoMsgS)
|
|
void CANNet_RecvMsgCAN1(MCANDrv_infoMsgS_TYPE infoMsgS)
|
|
@@ -109,8 +124,25 @@ void CANNet_RecvMsgCAN1(MCANDrv_infoMsgS_TYPE infoMsgS)
|
|
infoBmsSendMsg.CanID = infoMsgS.infoConfS.infoMsgIDUI;
|
|
infoBmsSendMsg.CanID = infoMsgS.infoConfS.infoMsgIDUI;
|
|
memcpy(infoBmsSendMsg.CanData,infoMsgS.datMsgUBA,8);
|
|
memcpy(infoBmsSendMsg.CanData,infoMsgS.datMsgUBA,8);
|
|
BmsSendFlg = TRUE;
|
|
BmsSendFlg = TRUE;
|
|
-
|
|
|
|
CANNet_infoMsgTxConfSA[0].infoMsgIDUI = infoBmsSendMsg.CanID;
|
|
CANNet_infoMsgTxConfSA[0].infoMsgIDUI = infoBmsSendMsg.CanID;
|
|
|
|
+
|
|
|
|
+ if((infoBmsSendMsg.CanID==0x1880D0F3)&& 1)//主负继电器状态和主正一起发出
|
|
|
|
+ {
|
|
|
|
+ uint8 DataTemp = 0x00;
|
|
|
|
+ if(((infoBmsSendMsg.CanData[1]>>4)&0x03)==0x02)
|
|
|
|
+ {
|
|
|
|
+ DataTemp = infoBmsSendMsg.CanData[1]&0x3F;
|
|
|
|
+ DataTemp = DataTemp|((0x02)<<6);
|
|
|
|
+ infoBmsSendMsg.CanData[1] = DataTemp;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ DataTemp = infoBmsSendMsg.CanData[1]&0x3F;
|
|
|
|
+ DataTemp = DataTemp|((0x01)<<6);
|
|
|
|
+ infoBmsSendMsg.CanData[1] = DataTemp;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[0];
|
|
infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[0];
|
|
memset(infoMsgS.datMsgUBA, 0x00, 8);
|
|
memset(infoMsgS.datMsgUBA, 0x00, 8);
|
|
memcpy(infoMsgS.datMsgUBA,infoBmsSendMsg.CanData,8);
|
|
memcpy(infoMsgS.datMsgUBA,infoBmsSendMsg.CanData,8);
|