Commit 4d882308 authored by 李冠华's avatar 李冠华

feat:增加混动车型钥匙接入指示灯工作逻辑

parent dad8fcb5
......@@ -426,6 +426,25 @@ void CAN_0x220_Receive(uint8_t CopyData [])
g_SeatCount = 0U;
}
if ((Get_CAN_CH0_ID_220_Sig_VCU_KeySts() == 1U) && (g_KeyStatus == 0U))
{
if (g_KeyCount < 3U)
{
g_KeyCount++;
}
}
else if ((Get_CAN_CH0_ID_220_Sig_VCU_KeySts() == 0U) && (g_KeyStatus == 1U))
{
if (g_KeyCount < 3U)
{
g_KeyCount++;
}
}
else
{
g_KeyCount = 0U;
}
#endif
}
......@@ -74,6 +74,8 @@ uint8_t g_GrassSwStatus = 0U;
uint8_t g_GrassSwCount = 0U;
uint8_t g_SeatStatus = 0U;
uint8_t g_SeatCount = 0U;
uint8_t g_KeyStatus = 0U;
uint8_t g_KeyCount = 0U;
const LED_Attribute_st LED_Attribute[LED_Max] =
{
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
......@@ -126,6 +128,8 @@ void Telltales_Init(void)
g_GrassSwCount = 0U;
g_SeatStatus = 0U;
g_SeatCount = 0U;
g_KeyStatus = 0U;
g_KeyCount = 0U;
Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara);
}
......@@ -451,15 +455,30 @@ static void LED_Seat_Detection_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_Key_Access_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_TOTALSigAcc();
if ((Signal1 == 0x1) && openLED_flag)
{
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
#if (PART_NUMBER == RMR42E_60)
Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_TOTALSigAcc();
if ((Signal1 == 0x1) && openLED_flag)
{
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
#else
if ((g_KeyStatus == 0U) && (g_KeyCount >= 3U))
{
g_KeyStatus = 1U;
}
else if ((g_KeyStatus == 1U) && (g_KeyCount >= 3U))
{
g_KeyStatus = 0U;
}
LED_STATE = (Tellib_uint16_t) g_KeyStatus;
#endif
return LED_STATE;
}
static void LED_Key_Access_Execution(Tellib_uint16_t led_status)
......
......@@ -55,6 +55,8 @@ extern uint8_t g_GrassSwStatus;
extern uint8_t g_GrassSwCount;
extern uint8_t g_SeatStatus;
extern uint8_t g_SeatCount;
extern uint8_t g_KeyStatus;
extern uint8_t g_KeyCount;
// extern Tellib_uint8_t Auto_Start_Stop ;
......
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