提交 6152cb7a 作者: wysheng

修复“充电启动应答帧”优先级

上级 6f621aed
...@@ -594,10 +594,10 @@ void StartMeg(StructTCUSend * pPgnRecv) ...@@ -594,10 +594,10 @@ void StartMeg(StructTCUSend * pPgnRecv)
if (pPgnRecv->DA == ChargerCont1939Addr) if (pPgnRecv->DA == ChargerCont1939Addr)
{ {
if ((TCUCurChgRecd.TCUChgStartNotetrl == 0) && (TCUCurChgRecd.TCUChargeEnable == 0) && if ((TCUCurChgRecd.TCUChgStartNotetrl == 0) && (TCUCurChgRecd.TCUChargeEnable == 0) &&
((eLcdPro_TCUMainMenu == TCUCtrl.CurScreen) || (eLcdPro_TCUChargeSummary_B == TCUCtrl.CurScreen))) ((eLcdPro_TCUMainMenu == TCUCtrl.CurScreen) || (eLcdPro_TCUChargeSummary == TCUCtrl.CurScreen)))
{ {
StartMeg_A.GunNum = 0;//pPgnRecv->Data[0]; //StartMeg_A.GunNum = 0;//pPgnRecv->Data[0];
StartMeg_A.LoadSswitch = pPgnRecv->Data[1]; StartMeg_A.LoadSswitch = pPgnRecv->Data[1];
StartMeg_A.PlugToChgFlag = pPgnRecv->Data[2]; StartMeg_A.PlugToChgFlag = pPgnRecv->Data[2];
StartMeg_A.AuxiliaryPower = pPgnRecv->Data[3]; StartMeg_A.AuxiliaryPower = pPgnRecv->Data[3];
...@@ -631,9 +631,9 @@ void StartMeg(StructTCUSend * pPgnRecv) ...@@ -631,9 +631,9 @@ void StartMeg(StructTCUSend * pPgnRecv)
else if (pPgnRecv->DA == ChargerCont1939Addr_B) else if (pPgnRecv->DA == ChargerCont1939Addr_B)
{ {
if ((TCUCurChgRecd_B.TCUChgStartNotetrl == 0) && (TCUCurChgRecd_B.TCUChargeEnable == 0) && if ((TCUCurChgRecd_B.TCUChgStartNotetrl == 0) && (TCUCurChgRecd_B.TCUChargeEnable == 0) &&
((eLcdPro_TCUMainMenu == TCUCtrl.CurScreen) || (eLcdPro_TCUChargeSummary == TCUCtrl.CurScreen))) ((eLcdPro_TCUMainMenu == TCUCtrl.CurScreen) || (eLcdPro_TCUChargeSummary_B == TCUCtrl.CurScreen)))
{ {
StartMeg_B.GunNum = 0;//pPgnRecv->Data[0]; //StartMeg_B.GunNum = 0;//pPgnRecv->Data[0];
StartMeg_B.LoadSswitch = pPgnRecv->Data[1]; StartMeg_B.LoadSswitch = pPgnRecv->Data[1];
StartMeg_B.PlugToChgFlag = pPgnRecv->Data[2]; StartMeg_B.PlugToChgFlag = pPgnRecv->Data[2];
StartMeg_B.AuxiliaryPower = pPgnRecv->Data[3]; StartMeg_B.AuxiliaryPower = pPgnRecv->Data[3];
...@@ -730,11 +730,11 @@ u8 AllowDTUStartCharge_B(u8 * Reason) ...@@ -730,11 +730,11 @@ u8 AllowDTUStartCharge_B(u8 * Reason)
{ {
if (TCUCurChgRecd_B.StarValid == 0) if (TCUCurChgRecd_B.StarValid == 0)
*Reason = 0x01; *Reason = 0x01;
else if (TCUCommuStatus.ConnectFlag == CONNECT_TIMEOUT) else if (TCUCommuStatus_B.ConnectFlag == CONNECT_TIMEOUT)
*Reason = 0x02; *Reason = 0x02;
else if (TCUCommuStatus.VerChkVaild == 0) else if (TCUCommuStatus_B.VerChkVaild == 0)
*Reason = 0x03; *Reason = 0x03;
else if (TCUCommuStatus.ParamVaild == 0) else if (TCUCommuStatus_B.ParamVaild == 0)
*Reason = 0x05; *Reason = 0x05;
else if (ChargeCtrl_B.CurProcess != eChgPro_B_ChgIdle) else if (ChargeCtrl_B.CurProcess != eChgPro_B_ChgIdle)
*Reason = 0x06; *Reason = 0x06;
...@@ -750,11 +750,11 @@ u8 AllowDTUStartCharge_B(u8 * Reason) ...@@ -750,11 +750,11 @@ u8 AllowDTUStartCharge_B(u8 * Reason)
*Reason = 0x0B; *Reason = 0x0B;
else if (PillarError_B.Value.EleLock == 1) else if (PillarError_B.Value.EleLock == 1)
*Reason = 0x0F; *Reason = 0x0F;
else if ((PillarError.Value.Insulation == 1) || (PillarError.Value.ImdDev == 1)) else if ((PillarError_B.Value.Insulation == 1) || (PillarError_B.Value.ImdDev == 1))
*Reason = 0x010; *Reason = 0x010;
else if (ChargeStopType_B == eChgStop_PillarReady_BatVoltError) else if (ChargeStopType_B == eChgStop_PillarReady_BatVoltError)
*Reason = 0x11; *Reason = 0x11;
else if ((ChargeStopType_B == eChgStop_Imd_BhmTimeOut) || (ChargeStopType == eChgStop_ComBreak_CommError)) else if ((ChargeStopType_B == eChgStop_Imd_BhmTimeOut) || (ChargeStopType_B == eChgStop_ComBreak_CommError))
*Reason = 0x12; *Reason = 0x12;
else if (PillarError_B.Value.ACContactor == 1) else if (PillarError_B.Value.ACContactor == 1)
*Reason = 0x13; *Reason = 0x13;
...@@ -802,7 +802,7 @@ void StartMegAck_A(void) ...@@ -802,7 +802,7 @@ void StartMegAck_A(void)
Data[5] = StartMeg_A.PlugToChgFlag; Data[5] = StartMeg_A.PlugToChgFlag;
Data[6] = StartMeg_A.AuxiliaryPower; Data[6] = StartMeg_A.AuxiliaryPower;
Data[7] = StartMeg_A.ParallelCharging; Data[7] = StartMeg_A.ParallelCharging;
TCUSinglePackSendMsg(Data, 8, eCmd_startAck, 6,ChargerCont1939Addr); TCUSinglePackSendMsg(Data, 8, eCmd_startAck, 4,ChargerCont1939Addr);
} }
...@@ -827,7 +827,7 @@ void StartMegAck_B(void) ...@@ -827,7 +827,7 @@ void StartMegAck_B(void)
Data[5] = StartMeg_B.PlugToChgFlag; Data[5] = StartMeg_B.PlugToChgFlag;
Data[6] = StartMeg_B.AuxiliaryPower; Data[6] = StartMeg_B.AuxiliaryPower;
Data[7] = StartMeg_B.ParallelCharging; Data[7] = StartMeg_B.ParallelCharging;
TCUSinglePackSendMsg(Data, 8, eCmd_startAck, 6,ChargerCont1939Addr_B); TCUSinglePackSendMsg(Data, 8, eCmd_startAck, 4,ChargerCont1939Addr_B);
} }
...@@ -904,7 +904,7 @@ u8 AllowDTUStartCompCharge_B(u8 * Reason) ...@@ -904,7 +904,7 @@ u8 AllowDTUStartCompCharge_B(u8 * Reason)
*Reason = 0x0; //成功 *Reason = 0x0; //成功
return TRUE; return TRUE;
} }
else if (TCUCommuStatus.ConnectFlag == CONNECT_TIMEOUT) else if (TCUCommuStatus_B.ConnectFlag == CONNECT_TIMEOUT)
*Reason = 0x02; //通讯超时 *Reason = 0x02; //通讯超时
else if (PillarError_B.Value.Emergency == 1) else if (PillarError_B.Value.Emergency == 1)
*Reason = 0x03; *Reason = 0x03;
...@@ -948,13 +948,13 @@ u8 AllowDTUStartCompCharge_B(u8 * Reason) ...@@ -948,13 +948,13 @@ u8 AllowDTUStartCompCharge_B(u8 * Reason)
*Reason = 0x24; *Reason = 0x24;
else if (CemMsg_B.Cem.Value.Bro == 1) else if (CemMsg_B.Cem.Value.Bro == 1)
*Reason = 0x27; *Reason = 0x27;
else if ((CemMsg_B.Cem.Value.Bro != 0) || (ChargeStopType != 0)) else if ((CemMsg_B.Cem.Value.Bro != 0) || (ChargeStopType_B != 0))
*Reason = 0x28; *Reason = 0x28;
else if ((VerificaInfo_B.result == 1) && (StartMeg_B.PlugToChgFlag == 1)) else if ((VerificaInfo_B.result == 1) && (StartMeg_B.PlugToChgFlag == 1))
*Reason = 0x29; *Reason = 0x29;
else if (TCUCommuStatus_B.ErrData.Value.verificationAck == 1) else if (TCUCommuStatus_B.ErrData.Value.verificationAck == 1)
*Reason = 0x30; *Reason = 0x30;
else if (TCUCurChgRecd.TCUStartCompresult == 2) else if (TCUCurChgRecd_B.TCUStartCompresult == 2)
*Reason = 0x01; //控制导引故障 *Reason = 0x01; //控制导引故障
else else
* Reason = 0x28; //其他故障 * Reason = 0x28; //其他故障
...@@ -969,7 +969,7 @@ void startCompSend_A(void) ...@@ -969,7 +969,7 @@ void startCompSend_A(void)
u8 len = 0; u8 len = 0;
u8 reason; u8 reason;
Data[len++] = StartMeg_A.GunNum; Data[len++] = 0;
Data[len++] = StartMeg_A.LoadSswitch; Data[len++] = StartMeg_A.LoadSswitch;
if (FALSE == AllowDTUStartCompCharge(&reason)) if (FALSE == AllowDTUStartCompCharge(&reason))
...@@ -1047,7 +1047,7 @@ void startCompSend_B(void) ...@@ -1047,7 +1047,7 @@ void startCompSend_B(void)
u8 len = 0; u8 len = 0;
u8 reason; u8 reason;
Data[len++] = StartMeg_B.GunNum; Data[len++] = 0;
Data[len++] = StartMeg_B.LoadSswitch; Data[len++] = StartMeg_B.LoadSswitch;
if (FALSE == AllowDTUStartCompCharge_B(&reason)) if (FALSE == AllowDTUStartCompCharge_B(&reason))
...@@ -1121,7 +1121,7 @@ void ACkStartCompMeg(StructTCUSend * pPgnRecv) ...@@ -1121,7 +1121,7 @@ void ACkStartCompMeg(StructTCUSend * pPgnRecv)
{ {
if (pPgnRecv->DA == ChargerCont1939Addr) if (pPgnRecv->DA == ChargerCont1939Addr)
{ {
AckStartCompMeg_A.GunNum = 0;//pPgnRecv->Data[0]; //AckStartCompMeg_A.GunNum = 0;//pPgnRecv->Data[0];
AckStartCompMeg_A.LoadSswitch = pPgnRecv->Data[1]; AckStartCompMeg_A.LoadSswitch = pPgnRecv->Data[1];
AckStartCompMeg_A.AckFlag = pPgnRecv->Data[2]; AckStartCompMeg_A.AckFlag = pPgnRecv->Data[2];
...@@ -1134,7 +1134,7 @@ void ACkStartCompMeg(StructTCUSend * pPgnRecv) ...@@ -1134,7 +1134,7 @@ void ACkStartCompMeg(StructTCUSend * pPgnRecv)
} }
else if (pPgnRecv->DA == ChargerCont1939Addr_B) else if (pPgnRecv->DA == ChargerCont1939Addr_B)
{ {
AckStartCompMeg_B.GunNum = 0;//pPgnRecv->Data[0]; //AckStartCompMeg_B.GunNum = 0;//pPgnRecv->Data[0];
AckStartCompMeg_B.LoadSswitch = pPgnRecv->Data[1]; AckStartCompMeg_B.LoadSswitch = pPgnRecv->Data[1];
AckStartCompMeg_B.AckFlag = pPgnRecv->Data[2]; AckStartCompMeg_B.AckFlag = pPgnRecv->Data[2];
...@@ -1445,14 +1445,14 @@ void stopCompAck(StructTCUSend * pPgnRecv) ...@@ -1445,14 +1445,14 @@ void stopCompAck(StructTCUSend * pPgnRecv)
if (pPgnRecv->DA == ChargerCont1939Addr) if (pPgnRecv->DA == ChargerCont1939Addr)
{ {
AckStopCompMeg_A.GunNum = 0;//pPgnRecv->Data[0]; //AckStopCompMeg_A.GunNum = 0;//pPgnRecv->Data[0];
AckStopCompMeg_A.StopReason = pPgnRecv->Data[1]; AckStopCompMeg_A.StopReason = pPgnRecv->Data[1];
AckStopCompMeg_A.AckFlag = pPgnRecv->Data[2]; AckStopCompMeg_A.AckFlag = pPgnRecv->Data[2];
TCUCurChgRecd.TCUChgStopCompNotetrl = 3; //停止完成帧命令发送 TCUCurChgRecd.TCUChgStopCompNotetrl = 3; //停止完成帧命令发送
} }
else if (pPgnRecv->DA == ChargerCont1939Addr_B) else if (pPgnRecv->DA == ChargerCont1939Addr_B)
{ {
AckStopCompMeg_B.GunNum = 0;//pPgnRecv->Data[0]; //AckStopCompMeg_B.GunNum = 0;//pPgnRecv->Data[0];
AckStopCompMeg_B.StopReason = pPgnRecv->Data[1]; AckStopCompMeg_B.StopReason = pPgnRecv->Data[1];
AckStopCompMeg_B.AckFlag = pPgnRecv->Data[2]; AckStopCompMeg_B.AckFlag = pPgnRecv->Data[2];
TCUCurChgRecd_B.TCUChgStopCompNotetrl = 3; //停止完成帧命令发送 TCUCurChgRecd_B.TCUChgStopCompNotetrl = 3; //停止完成帧命令发送
...@@ -2026,7 +2026,7 @@ void PowerControlAck(u8 ChgNum) ...@@ -2026,7 +2026,7 @@ void PowerControlAck(u8 ChgNum)
u8 InsertGunStatu_A(void) u8 InsertGunStatu_A(void)
{ {
u8 status; u8 status=0;
return status; return status;
} }
...@@ -2034,7 +2034,7 @@ u8 InsertGunStatu_A(void) ...@@ -2034,7 +2034,7 @@ u8 InsertGunStatu_A(void)
u8 InsertGunStatu_B(void) u8 InsertGunStatu_B(void)
{ {
u8 status; u8 status=0;
return status; return status;
} }
......
...@@ -55,7 +55,7 @@ typedef struct ...@@ -55,7 +55,7 @@ typedef struct
typedef struct typedef struct
{ {
u8 GunNum; //抢号 单枪 0 一机多冲 1-255 //u8 GunNum; //抢号 单枪 0 一机多冲 1-255
u8 LoadSswitch;//负荷控制开关 是否根据用户型号提供不同输出功率 01启用02关闭其他无效 u8 LoadSswitch;//负荷控制开关 是否根据用户型号提供不同输出功率 01启用02关闭其他无效
u8 PlugToChgFlag;//即插即充标识 00非 01 即插即充other:invalid u8 PlugToChgFlag;//即插即充标识 00非 01 即插即充other:invalid
u8 AuxiliaryPower;//辅助电源选择:00H:使用12V(默认)01H: 24V(优先使用12V探测,失败后切24V电源探测)其他:无效 u8 AuxiliaryPower;//辅助电源选择:00H:使用12V(默认)01H: 24V(优先使用12V探测,失败后切24V电源探测)其他:无效
...@@ -63,14 +63,14 @@ typedef struct ...@@ -63,14 +63,14 @@ typedef struct
}StructStartMeg; }StructStartMeg;
typedef struct typedef struct
{ {
u8 GunNum; //抢号 单枪 0 一机多冲 1-255 //u8 GunNum; //抢号 单枪 0 一机多冲 1-255
u8 LoadSswitch;//负荷控制开关 是否根据用户型号提供不同输出功率 01启用02关闭其他无效 u8 LoadSswitch;//负荷控制开关 是否根据用户型号提供不同输出功率 01启用02关闭其他无效
u8 AckFlag; u8 AckFlag;
u32 RecvTick; u32 RecvTick;
}StructStartCompMeg; }StructStartCompMeg;
typedef struct typedef struct
{ {
u8 GunNum; //抢号 单枪 0 一机多冲 1-255 //u8 GunNum; //抢号 单枪 0 一机多冲 1-255
u8 StopReason; u8 StopReason;
u8 AckFlag; u8 AckFlag;
}StructStopCompMeg; }StructStopCompMeg;
...@@ -84,7 +84,7 @@ typedef enum ...@@ -84,7 +84,7 @@ typedef enum
}stopReason; }stopReason;
typedef struct typedef struct
{ {
u8 GunNum; //抢号 单枪 0 一机多冲 1-255 //u8 GunNum; //抢号 单枪 0 一机多冲 1-255
stopReason StopReason;// stopReason StopReason;//
}StructStopMeg; }StructStopMeg;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论