Commit 0cac83fa authored by 李冠华's avatar 李冠华

feat:混动车型增加发动机故障指示灯逻辑

parent 55ef3cf6
...@@ -153,7 +153,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -153,7 +153,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
500ul, 500ul,
0x225ul, 0x225ul,
((void *)0), ((void *)0),
((void *)0), (CAN_0x225_Receive),
((void *)0), ((void *)0),
}, },
}; };
......
...@@ -110,6 +110,7 @@ extern uint8_t Get_CAN_CH0_ID_339_Sig_MMCU_SingleWorkingHours(void); ...@@ -110,6 +110,7 @@ extern uint8_t Get_CAN_CH0_ID_339_Sig_MMCU_SingleWorkingHours(void);
extern uint8_t Get_CAN_CH0_ID_18200A21_Sig_SBMS_Soc(void); extern uint8_t Get_CAN_CH0_ID_18200A21_Sig_SBMS_Soc(void);
extern uint8_t Get_CAN_CH0_ID_134_Sig_SMCU_ErrorGrage(void); extern uint8_t Get_CAN_CH0_ID_134_Sig_SMCU_ErrorGrage(void);
extern uint8_t Get_CAN_CH0_ID_220_Sig_VCU_KeySts(void); extern uint8_t Get_CAN_CH0_ID_220_Sig_VCU_KeySts(void);
extern uint8_t Get_CAN_CH0_ID_225_Sig_VCU_EmsFltLv3(void);
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
#include "Telltales_Lib.h" #include "Telltales_Lib.h"
#include "Telltales_user.h" #include "Telltales_user.h"
#include "Line_In\Line_In_user.h" #include "Line_In\Line_In_user.h"
#include "Application.h"
#include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h" #include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h"
#include "Components.h" #include "Application.h"
#define openLED_flag ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Charge_OFF_Flag == 0) && (Get_CAN_Power_State() != POWER_CHECK_NULL)) #define openLED_flag ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Charge_OFF_Flag == 0) && (Get_CAN_Power_State() != POWER_CHECK_NULL))
static Tellib_uint16_t LED_EFI_failure_Judgement(void); static Tellib_uint16_t LED_EFI_failure_Judgement(void);
static void LED_EFI_failure_Execution(Tellib_uint16_t led_status); static void LED_EFI_failure_Execution(Tellib_uint16_t led_status);
...@@ -63,6 +63,8 @@ static void LED_Charging_Connection_R_Execution(Tellib_uint16_t led_status); ...@@ -63,6 +63,8 @@ static void LED_Charging_Connection_R_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void); static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void);
static void LED_Power_Battery_Failure_R_Execution(Tellib_uint16_t led_status); static void LED_Power_Battery_Failure_R_Execution(Tellib_uint16_t led_status);
uint8_t u8CanId401Flag = 0; uint8_t u8CanId401Flag = 0;
uint8_t g_u8EmsFltLv3Count = 0U;
uint8_t g_EngineMalfunctionStatus = 0U;
const LED_Attribute_st LED_Attribute[LED_Max] = const LED_Attribute_st LED_Attribute[LED_Max] =
{ {
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */ /* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
...@@ -106,6 +108,8 @@ void Telltales_Init(void) ...@@ -106,6 +108,8 @@ void Telltales_Init(void)
m_ExtPara.LED_PowerCbk = Common_Get_IG_Sts; m_ExtPara.LED_PowerCbk = Common_Get_IG_Sts;
PowerSts_num = Common_Get_IG_Sts(); PowerSts_num = Common_Get_IG_Sts();
u8CanId401Flag = 0; u8CanId401Flag = 0;
g_u8EmsFltLv3Count = 0U;
g_EngineMalfunctionStatus = 0U;
Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara); Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara);
} }
...@@ -114,31 +118,59 @@ void Can_ID_401(uint8_t CopyData[]) ...@@ -114,31 +118,59 @@ void Can_ID_401(uint8_t CopyData[])
u8CanId401Flag = 1; u8CanId401Flag = 1;
} }
void CAN_0x225_Receive(uint8_t CopyData [])
{
#if (PART_NUMBER == G54_A01)
if ((Get_CAN_CH0_ID_225_Sig_VCU_EmsFltLv3() == 1U) && (g_EngineMalfunctionStatus == 0U))
{
if (g_u8EmsFltLv3Count < 3U)
{
g_u8EmsFltLv3Count++;
}
}
else if ((Get_CAN_CH0_ID_225_Sig_VCU_EmsFltLv3() == 0U) && (g_EngineMalfunctionStatus == 1U))
{
g_u8EmsFltLv3Count++;
}
else
{
g_u8EmsFltLv3Count = 0U;
}
#endif
}
static Tellib_uint16_t LED_EFI_failure_Judgement(void) static Tellib_uint16_t LED_EFI_failure_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_HighBeam))
// { #if (PART_NUMBER == G54_A01)
// LED_STATE = 1; if ((g_EngineMalfunctionStatus == 0U) && (g_u8EmsFltLv3Count >= 3U))
// } {
// else g_EngineMalfunctionStatus = 1U;
// { }
// LED_STATE = 0; else if ((g_EngineMalfunctionStatus == 1U) && (g_u8EmsFltLv3Count >= 3U))
// } {
g_EngineMalfunctionStatus = 0U;
}
LED_STATE = (Tellib_uint16_t) g_EngineMalfunctionStatus;
#endif
return LED_STATE; return LED_STATE;
} }
static void LED_EFI_failure_Execution(Tellib_uint16_t led_status) static void LED_EFI_failure_Execution(Tellib_uint16_t led_status)
{ {
#if (PART_NUMBER == G54_A01)
if (led_status == 1u) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_09_EFI_failure_Y, LED_ON);
// SEG_SET_LED_STS(1,1); SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_09_EFI_failure_Y, LED_OFF);
// SEG_SET_LED_STS(1,0); SEG_SET_LED_STS(1,0);
} }
#endif
} }
static Tellib_uint16_t LED_Fuel_Alarm_Judgement(void) static Tellib_uint16_t LED_Fuel_Alarm_Judgement(void)
{ {
......
#ifndef TELLTALES_USER_H #ifndef TELLTALES_USER_H
#define TELLTALES_USER_H #define TELLTALES_USER_H
#include "Components.h"
typedef enum typedef enum
{ {
...@@ -47,5 +48,6 @@ void Telltales_Init(void); ...@@ -47,5 +48,6 @@ void Telltales_Init(void);
// void Telltales_Auto_Start_Stop(void); // void Telltales_Auto_Start_Stop(void);
// void Telltales_Auto_Start_Stop_Setting(void); // void Telltales_Auto_Start_Stop_Setting(void);
Tellib_uint8_t Telltales_Voltage_Date(void); Tellib_uint8_t Telltales_Voltage_Date(void);
extern void CAN_0x225_Receive(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