Commit 1ea77137 authored by 李冠华's avatar 李冠华

feat:修改混动车型,电量信号报文掉线后,电量条、总电量值、电量标志显示效果

parent fa2b2673
...@@ -606,7 +606,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -606,7 +606,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
500ul, 500ul,
0x17Aul, 0x17Aul,
(( void * )0), (( void * )0),
(( void * )0), (CAN_0x17A_Receive),
(( void * )0), (( void * )0),
}, },
{ {
......
...@@ -667,3 +667,8 @@ void CAN_0x339_Receive(uint8_t CopyData []) ...@@ -667,3 +667,8 @@ void CAN_0x339_Receive(uint8_t CopyData [])
{ {
g_u8ID339flag = 1U; g_u8ID339flag = 1U;
} }
void CAN_0x17A_Receive(uint8_t CopyData [])
{
g_Msg0x17AFlag = 1U;
}
...@@ -46,5 +46,6 @@ extern void CAN_0x16B_Receive(uint8_t CopyData []); ...@@ -46,5 +46,6 @@ extern void CAN_0x16B_Receive(uint8_t CopyData []);
extern void CAN_0x22F_Receive(uint8_t CopyData []); extern void CAN_0x22F_Receive(uint8_t CopyData []);
extern void CAN_0x170_Receive(uint8_t CopyData []); extern void CAN_0x170_Receive(uint8_t CopyData []);
extern void CAN_0x339_Receive(uint8_t CopyData []); extern void CAN_0x339_Receive(uint8_t CopyData []);
extern void CAN_0x17A_Receive(uint8_t CopyData []);
#endif #endif
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
SocStruct_st_t Soc; SocStruct_st_t Soc;
uint8_t SOC_Count_Time = 0; uint8_t SOC_Count_Time = 0;
uint8_t g_Msg0x17AFlag = 0U;
uint16_t SocPoweroffTime = 0; uint16_t SocPoweroffTime = 0;
static void Data_Soc_Battery_Level_Service(void); static void Data_Soc_Battery_Level_Service(void);
...@@ -26,6 +27,7 @@ void Data_Soc_KL30_Init(void) ...@@ -26,6 +27,7 @@ void Data_Soc_KL30_Init(void)
Soc.AllSocValue = 0U; Soc.AllSocValue = 0U;
Soc.AllSocValid = 0U; Soc.AllSocValid = 0U;
SocPoweroffTime = 0U; SocPoweroffTime = 0U;
g_Msg0x17AFlag = 0U;
} }
void Data_Soc_KL15_Init(void) void Data_Soc_KL15_Init(void)
...@@ -117,16 +119,11 @@ static void Data_Soc_Battery_Level_Service(void) ...@@ -117,16 +119,11 @@ static void Data_Soc_Battery_Level_Service(void)
if (Get_CAN_Power_State() > KEY_OFF) if (Get_CAN_Power_State() > KEY_OFF)
{ {
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x17A_Msg)) == CAN_SIG_NORMAL) if ((CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x17A_Msg)) == CAN_SIG_NORMAL) && (g_Msg0x17AFlag == 1U))
{ {
Soc.Value1 = Get_CAN_CH0_ID_17A_Sig_MBMS_StatSoc(); Soc.Value1 = Get_CAN_CH0_ID_17A_Sig_MBMS_StatSoc();
Soc.Valid1 = 1U; Soc.Valid1 = 1U;
} }
else
{
Soc.Value1 = 0U;
Soc.Valid1 = 0U;
}
if (Soc.Valid1 != 0U) if (Soc.Valid1 != 0U)
{ {
...@@ -376,7 +373,6 @@ static void Data_Soc_DisplayEffect_Service(void) ...@@ -376,7 +373,6 @@ static void Data_Soc_DisplayEffect_Service(void)
} }
else else
{ {
Soc.Valid1 = 1U;
SocPoweroffTime ++; SocPoweroffTime ++;
} }
} }
...@@ -384,17 +380,12 @@ static void Data_Soc_DisplayEffect_Service(void) ...@@ -384,17 +380,12 @@ static void Data_Soc_DisplayEffect_Service(void)
{ {
Soc.Valid1 = 0U; Soc.Valid1 = 0U;
} }
else
{
Soc.Valid1 = 1U;
}
} }
else else
{ {
if (Get_CAN_Power_State() == KEY_ACC) if (Get_CAN_Power_State() == KEY_ACC)
{ {
Soc.Dis_Seg1 = Soc.Act_Seg1; Soc.Dis_Seg1 = Soc.Act_Seg1;
Soc.Valid1 = 1U;
} }
else else
{ {
...@@ -512,19 +503,20 @@ static void Data_Soc_All_Soc_Service(void) ...@@ -512,19 +503,20 @@ static void Data_Soc_All_Soc_Service(void)
Soc.AllSocValid = 0U; Soc.AllSocValid = 0U;
} }
#else #else
uint8_t MBMSStatSoc = Get_CAN_CH0_ID_17A_Sig_MBMS_StatSoc();
uint8_t VCUChgMode = Get_CAN_CH0_ID_220_Sig_VCU_ChgMode(); uint8_t VCUChgMode = Get_CAN_CH0_ID_220_Sig_VCU_ChgMode();
if (MBMSStatSoc > 100U) if ((CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x17A_Msg)) == CAN_SIG_NORMAL) && (g_Msg0x17AFlag == 1U))
{ {
MBMSStatSoc = 100u; Soc.AllSocValue = Get_CAN_CH0_ID_17A_Sig_MBMS_StatSoc();
if (Soc.AllSocValue > 100U)
{
Soc.AllSocValue = 100u;
}
} }
if (VCUChgMode == 1U) if (VCUChgMode == 1U)
{ {
if (Get_CAN_Power_State() > KEY_OFF) if (Get_CAN_Power_State() > KEY_OFF)
{ {
Soc.AllSocValue = MBMSStatSoc;
Soc.AllSocValid = 1U; Soc.AllSocValid = 1U;
} }
else else
...@@ -542,7 +534,6 @@ static void Data_Soc_All_Soc_Service(void) ...@@ -542,7 +534,6 @@ static void Data_Soc_All_Soc_Service(void)
} }
else else
{ {
Soc.AllSocValue = MBMSStatSoc;
Soc.AllSocValid = 1U; Soc.AllSocValid = 1U;
} }
} }
......
...@@ -35,6 +35,7 @@ typedef struct //__attribute__((aligned(4))) ...@@ -35,6 +35,7 @@ typedef struct //__attribute__((aligned(4)))
}SocStruct_st_t; }SocStruct_st_t;
extern uint8_t g_Msg0x17AFlag;
extern void Data_Soc_KL30_Init(void); extern void Data_Soc_KL30_Init(void);
extern void Data_Soc_KL15_Init(void); extern void Data_Soc_KL15_Init(void);
......
...@@ -663,7 +663,7 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG) ...@@ -663,7 +663,7 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG)
#if (PART_NUMBER == RMR42E_60) #if (PART_NUMBER == RMR42E_60)
if (((m_Flag == 1u) && (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A20_Msg)) == CAN_SIG_NORMAL)) || (checkself_seg_Flag == 1)) if (((m_Flag == 1u) && (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A20_Msg)) == CAN_SIG_NORMAL)) || (checkself_seg_Flag == 1))
#else #else
if (((m_Flag == 1u) && (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x17A_Msg)) == CAN_SIG_NORMAL)) || (checkself_seg_Flag == 1)) if ((m_Flag == 1u) || (checkself_seg_Flag == 1))
#endif #endif
{ {
IC1_SEG136 = IC_SEG_GREY; IC1_SEG136 = IC_SEG_GREY;
......
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