Commit fd1fae2c authored by 李冠华's avatar 李冠华

feat:增加外发0x17A、0x38E、0x339报文超时状态功能

parent 83ca5fb4
...@@ -557,7 +557,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -557,7 +557,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
0x339ul, 0x339ul,
(( void * )0), (( void * )0),
(CAN_0x339_Receive), (CAN_0x339_Receive),
(( void * )0), (CAN_0x339_Lost_CallBack),
}, },
{ {
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
...@@ -607,7 +607,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -607,7 +607,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
0x17Aul, 0x17Aul,
(( void * )0), (( void * )0),
(CAN_0x17A_Receive), (CAN_0x17A_Receive),
(( void * )0), (CAN_0x17A_Lost_CallBack),
}, },
{ {
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
......
#include "Can_App.h" #include "Can_App.h"
uint8_t Msg0x17ALostFlag = 0U;
uint8_t Msg0x38ELostFlag = 0U;
uint8_t Msg0x339LostFlag = 0U;
void Can_Set_Buff_3A2(canlib_uint8_t CopyData[]) void Can_Set_Buff_3A2(canlib_uint8_t CopyData[])
{ {
...@@ -136,8 +139,30 @@ void Can_Set_Buff_3D4(canlib_uint8_t CopyData[]) ...@@ -136,8 +139,30 @@ void Can_Set_Buff_3D4(canlib_uint8_t CopyData[])
if (p3D4 != (void *)0) if (p3D4 != (void *)0)
{ {
p3D4->Sig.ICU_MasterBMSCommunicatlost = 0; p3D4->Sig.ICU_MasterBMSCommunicatlost = 0;
if (Msg0x17ALostFlag)
{
p3D4->Sig.ICU_SlaveBMSCommunicatlost = 1U;
}
else
{
p3D4->Sig.ICU_SlaveBMSCommunicatlost = 0; p3D4->Sig.ICU_SlaveBMSCommunicatlost = 0;
}
if (Msg0x339LostFlag)
{
p3D4->Sig.ICU_MCUCommunicatlost = 1U;
}
else
{
p3D4->Sig.ICU_MCUCommunicatlost = 0; p3D4->Sig.ICU_MCUCommunicatlost = 0;
}
if (Msg0x38ELostFlag)
{
p3D4->Sig.ICU_BMCUCommunicatlost = 1U;
}
else
{
p3D4->Sig.ICU_BMCUCommunicatlost = 0;
}
p3D4->Sig.ICU_VCUCommunicatlost = 0; p3D4->Sig.ICU_VCUCommunicatlost = 0;
p3D4->Sig.Res0 = 0x0; p3D4->Sig.Res0 = 0x0;
p3D4->Sig.Res1 = 0x00; p3D4->Sig.Res1 = 0x00;
...@@ -147,6 +172,7 @@ void Can_Set_Buff_3D4(canlib_uint8_t CopyData[]) ...@@ -147,6 +172,7 @@ void Can_Set_Buff_3D4(canlib_uint8_t CopyData[])
p3D4->Sig.Res5 = 0x00; p3D4->Sig.Res5 = 0x00;
p3D4->Sig.Res6 = 0x00; p3D4->Sig.Res6 = 0x00;
p3D4->Sig.Res7 = 0x00; p3D4->Sig.Res7 = 0x00;
p3D4->Sig.Res8 = 0x00;
} }
#endif #endif
} }
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#include "Application.h" #include "Application.h"
#include "Components.h" #include "Components.h"
extern uint8_t Msg0x17ALostFlag;
extern uint8_t Msg0x38ELostFlag;
extern uint8_t Msg0x339LostFlag;
void Can_Set_Buff_3A2(canlib_uint8_t CopyData[]); void Can_Set_Buff_3A2(canlib_uint8_t CopyData[]);
void Can_Set_Buff_3A7(canlib_uint8_t CopyData[]); void Can_Set_Buff_3A7(canlib_uint8_t CopyData[]);
void Can_Set_Buff_393(canlib_uint8_t CopyData[]); void Can_Set_Buff_393(canlib_uint8_t CopyData[]);
...@@ -119,14 +123,24 @@ typedef union ...@@ -119,14 +123,24 @@ typedef union
uint8_t ICU_SlaveBMSCommunicatlost : 1; uint8_t ICU_SlaveBMSCommunicatlost : 1;
uint8_t ICU_MCUCommunicatlost : 1; uint8_t ICU_MCUCommunicatlost : 1;
uint8_t ICU_VCUCommunicatlost : 1; uint8_t ICU_VCUCommunicatlost : 1;
uint8_t Res0: 4; uint8_t Res0: 2;
uint8_t ICU_BMCUCommunicatlost: 1;
uint8_t Res8: 1;
uint8_t Res1: 8; uint8_t Res1: 8;
uint8_t Res2: 8; uint8_t Res2: 8;
uint8_t Res3: 8; uint8_t Res3: 8;
uint8_t Res4: 8; uint8_t Res4: 8;
uint8_t Res5: 8; uint8_t Res5: 8;
uint8_t Res6 : 8; uint8_t Res6 : 8;
uint8_t Res7 : 8; uint8_t Res7 : 8;
} Sig; } Sig;
......
...@@ -413,6 +413,8 @@ void CAN_0x38E_Receive(uint8_t CopyData []) ...@@ -413,6 +413,8 @@ void CAN_0x38E_Receive(uint8_t CopyData [])
} }
} }
Msg0x38ELostFlag = 0U;
#endif #endif
} }
...@@ -672,11 +674,13 @@ void CAN_0x170_Receive(uint8_t CopyData []) ...@@ -672,11 +674,13 @@ void CAN_0x170_Receive(uint8_t CopyData [])
void CAN_0x339_Receive(uint8_t CopyData []) void CAN_0x339_Receive(uint8_t CopyData [])
{ {
g_u8ID339flag = 1U; g_u8ID339flag = 1U;
Msg0x339LostFlag = 0U;
} }
void CAN_0x17A_Receive(uint8_t CopyData []) void CAN_0x17A_Receive(uint8_t CopyData [])
{ {
g_Msg0x17AFlag = 1U; g_Msg0x17AFlag = 1U;
Msg0x17ALostFlag = 0U;
} }
void CAN_0x18E_Lost_CallBack(uint8_t CopyData []) void CAN_0x18E_Lost_CallBack(uint8_t CopyData [])
...@@ -703,6 +707,7 @@ void CAN_0x38E_Lost_CallBack(uint8_t CopyData []) ...@@ -703,6 +707,7 @@ void CAN_0x38E_Lost_CallBack(uint8_t CopyData [])
{ {
g_OverLoadCount[i] = 0U; g_OverLoadCount[i] = 0U;
} }
Msg0x38ELostFlag = 1U;
} }
void CAN_0x16B_Lost_CallBack(uint8_t CopyData []) void CAN_0x16B_Lost_CallBack(uint8_t CopyData [])
...@@ -720,4 +725,13 @@ void CAN_0x170_Lost_CallBack(uint8_t CopyData []) ...@@ -720,4 +725,13 @@ void CAN_0x170_Lost_CallBack(uint8_t CopyData [])
g_TOTALSigChargeCount = 0U; g_TOTALSigChargeCount = 0U;
} }
void CAN_0x17A_Lost_CallBack(uint8_t CopyData [])
{
Msg0x17ALostFlag = 1U;
}
void CAN_0x339_Lost_CallBack(uint8_t CopyData [])
{
Msg0x339LostFlag = 1U;
}
...@@ -55,5 +55,8 @@ extern void CAN_0x38E_Lost_CallBack(uint8_t CopyData []); ...@@ -55,5 +55,8 @@ extern void CAN_0x38E_Lost_CallBack(uint8_t CopyData []);
extern void CAN_0x16B_Lost_CallBack(uint8_t CopyData []); extern void CAN_0x16B_Lost_CallBack(uint8_t CopyData []);
extern void CAN_0x22F_Lost_CallBack(uint8_t CopyData []); extern void CAN_0x22F_Lost_CallBack(uint8_t CopyData []);
extern void CAN_0x170_Lost_CallBack(uint8_t CopyData []); extern void CAN_0x170_Lost_CallBack(uint8_t CopyData []);
extern void CAN_0x17A_Lost_CallBack(uint8_t CopyData []);
extern void CAN_0x339_Lost_CallBack(uint8_t CopyData []);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment