Commit 5338b113 authored by 李冠华's avatar 李冠华

feat:混动车型增加动力电池故障指示功能逻辑

parent 8f8491e6
......@@ -322,6 +322,32 @@ void CAN_0x225_Receive(uint8_t CopyData [])
g_VoltLowCount = 0U;
}
uint8_t u8Signal[2] = {0,0};
u8Signal[0] = Get_CAN_CH0_ID_225_Sig_VCU_BmsFltLv3();
u8Signal[1] = Get_CAN_CH0_ID_225_Sig_VCU_BmsFltLv4();
for(uint8_t i = 0U; i < 2U; i++)
{
if ((u8Signal[i] == 1U) && (g_BmsFltStatus[i] == 0U))
{
if (g_BmsFltCount[i] < 3U)
{
g_BmsFltCount[i]++;
}
}
else if ((u8Signal[i] == 0U) && (g_BmsFltStatus[i] == 1U))
{
if (g_BmsFltCount[i] < 3U)
{
g_BmsFltCount[i]++;
}
}
else
{
g_BmsFltCount[i] = 0U;
}
}
#endif
}
......
......@@ -86,6 +86,8 @@ uint8_t g_PtoSwStatus = 0U;
uint8_t g_PtoSwCount = 0U;
uint8_t g_SysFltLampStatus = 0U;
uint8_t g_SysFltLampCount = 0U;
uint8_t g_BmsFltStatus[2] = {0U,0U};
uint8_t g_BmsFltCount[2] = {0U,0U};
const LED_Attribute_st LED_Attribute[LED_Max] =
{
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
......@@ -1153,27 +1155,45 @@ static void LED_Charging_Connection_R_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
// Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_StatBattChargeState();
// if ((Signal1 == 0x1) || (Signal1 == 0x2) ||(Signal1 == 0x3))
// {
// LED_STATE = 1;
// }
// else
// {
// LED_STATE = 0;
// }
#if (PART_NUMBER == G54_A01)
for(uint8_t i = 0U; i < 2U; i++)
{
if ((g_BmsFltStatus[i] == 0U) && (g_BmsFltCount[i] >= 3U))
{
g_BmsFltStatus[i] = 1U;
}
else if ((g_BmsFltStatus[i] == 1U) && (g_BmsFltCount[i] >= 3U))
{
g_BmsFltStatus[i] = 0U;
}
}
if ((g_BmsFltStatus[0] == 0U) && (g_BmsFltStatus[1] == 0U))
{
LED_STATE = 0U;
}
else
{
LED_STATE = 1U;
}
#endif
return LED_STATE;
}
static void LED_Power_Battery_Failure_R_Execution(Tellib_uint16_t led_status)
{
// if ( (led_status == 1u ) && openLED_flag)
// {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_ON);
// SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,1);
// }
// else
// {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_OFF);
// SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,0);
// }
#if (PART_NUMBER == G54_A01)
if (led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_ON);
SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,0);
}
#endif
}
......@@ -67,6 +67,8 @@ extern uint8_t g_PtoSwStatus;
extern uint8_t g_PtoSwCount;
extern uint8_t g_SysFltLampStatus;
extern uint8_t g_SysFltLampCount;
extern uint8_t g_BmsFltStatus[2];
extern uint8_t g_BmsFltCount[2];
// extern Tellib_uint8_t Auto_Start_Stop ;
void Telltales_Init(void);
......
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