Commit 8f8491e6 authored by 李冠华's avatar 李冠华

feat:混动车型增加系统故障指示灯工作逻辑

parent d754359a
......@@ -483,6 +483,24 @@ void CAN_0x220_Receive(uint8_t CopyData [])
g_PtoSwCount = 0U;
}
if ((Get_CAN_CH0_ID_220_Sig_VCU_SysFltLamp() == 1U) && (g_SysFltLampStatus == 0U))
{
if (g_SysFltLampCount < 3U)
{
g_SysFltLampCount++;
}
}
else if ((Get_CAN_CH0_ID_220_Sig_VCU_SysFltLamp() == 0U) && (g_SysFltLampStatus == 1U))
{
if (g_SysFltLampCount < 3U)
{
g_SysFltLampCount++;
}
}
else
{
g_SysFltLampCount = 0U;
}
#endif
}
......
......@@ -84,6 +84,8 @@ uint8_t g_WorkStatus = 0U;
uint8_t g_WorkCount = 0U;
uint8_t g_PtoSwStatus = 0U;
uint8_t g_PtoSwCount = 0U;
uint8_t g_SysFltLampStatus = 0U;
uint8_t g_SysFltLampCount = 0U;
const LED_Attribute_st LED_Attribute[LED_Max] =
{
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
......@@ -146,6 +148,8 @@ void Telltales_Init(void)
g_WorkCount = 0U;
g_PtoSwStatus = 0U;
g_PtoSwCount = 0U;
g_SysFltLampStatus = 0U;
g_SysFltLampCount = 0U;
Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara);
}
......@@ -1004,18 +1008,34 @@ static void LED_Fault_Codes_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_SystIndicator_R_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_ErrorGrage();
Tellib_uint8_t Signal2 = Get_CAN_Num_SMCU_ErrorGrage();
Tellib_uint8_t Signal3 = System_Indicator_CANFlag;
if (((Signal1 == 0x4) || (Signal1 == 0x5) || (Signal2 == 0x4) || (Signal2 == 0x5) || (Signal3 == 1)))
{
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
#if (PART_NUMBER == RMR42E_60)
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_ErrorGrage();
Tellib_uint8_t Signal2 = Get_CAN_Num_SMCU_ErrorGrage();
Tellib_uint8_t Signal3 = System_Indicator_CANFlag;
if (((Signal1 == 0x4) || (Signal1 == 0x5) || (Signal2 == 0x4) || (Signal2 == 0x5) || (Signal3 == 1)))
{
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
#else
if ((g_SysFltLampStatus == 0U) && (g_SysFltLampCount >= 3U))
{
g_SysFltLampStatus = 1U;
}
else if ((g_SysFltLampStatus == 1U) && (g_SysFltLampCount >= 3U))
{
g_SysFltLampStatus = 0U;
}
LED_STATE = (Tellib_uint16_t) g_SysFltLampStatus;
#endif
return LED_STATE;
}
static void LED_SystIndicator_R_Execution(Tellib_uint16_t led_status)
......
......@@ -65,6 +65,8 @@ extern uint8_t g_WorkStatus;
extern uint8_t g_WorkCount;
extern uint8_t g_PtoSwStatus;
extern uint8_t g_PtoSwCount;
extern uint8_t g_SysFltLampStatus;
extern uint8_t g_SysFltLampCount;
// 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