Commit 9ff4e1b6 authored by 李冠华's avatar 李冠华

feat:增加0x22F报文回调函数,混动车型增加发动机工作指示灯工作逻辑

parent 170872f7
...@@ -677,7 +677,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -677,7 +677,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
1000ul, 1000ul,
0x22Ful, 0x22Ful,
(( void * )0), (( void * )0),
(( void * )0), (CAN_0x22F_Receive),
(( void * )0), (( void * )0),
}, },
{ {
......
...@@ -502,3 +502,46 @@ void CAN_0x16B_Receive(uint8_t CopyData []) ...@@ -502,3 +502,46 @@ void CAN_0x16B_Receive(uint8_t CopyData [])
#endif #endif
} }
void CAN_0x22F_Receive(uint8_t CopyData [])
{
#if (PART_NUMBER == G54_A01)
uint8_t u8Signal = Get_CAN_CH0_ID_22F_Sig_EMS_WorkSts();
if ((u8Signal == 2U) && (g_WorkStatus != 2U))
{
if (g_WorkCount < 3U)
{
g_WorkCount++;
}
}
else if ((u8Signal == 3U) && (g_WorkStatus != 3U))
{
if (g_WorkCount < 3U)
{
g_WorkCount++;
}
}
else if ((u8Signal == 4U) && (g_WorkStatus != 4U))
{
if (g_WorkCount < 3U)
{
g_WorkCount++;
}
}
else if ((u8Signal != 2U) && (u8Signal != 3U) && (u8Signal != 4U) && (g_WorkStatus != 0U))
{
if (g_WorkCount < 3U)
{
g_WorkCount++;
}
}
else
{
g_WorkCount = 0U;
}
#endif
}
...@@ -43,5 +43,6 @@ extern void CAN_0x234_Receive(uint8_t CopyData []); ...@@ -43,5 +43,6 @@ extern void CAN_0x234_Receive(uint8_t CopyData []);
extern void CAN_0x38E_Receive(uint8_t CopyData []); extern void CAN_0x38E_Receive(uint8_t CopyData []);
extern void CAN_0x220_Receive(uint8_t CopyData []); extern void CAN_0x220_Receive(uint8_t CopyData []);
extern void CAN_0x16B_Receive(uint8_t CopyData []); extern void CAN_0x16B_Receive(uint8_t CopyData []);
extern void CAN_0x22F_Receive(uint8_t CopyData []);
#endif #endif
...@@ -80,6 +80,8 @@ uint8_t g_ReadyStatus = 0U; ...@@ -80,6 +80,8 @@ uint8_t g_ReadyStatus = 0U;
uint8_t g_ReadyCount = 0U; uint8_t g_ReadyCount = 0U;
uint8_t g_ChgModeStatus = 0U; uint8_t g_ChgModeStatus = 0U;
uint8_t g_ChgModeCount = 0U; uint8_t g_ChgModeCount = 0U;
uint8_t g_WorkStatus = 0U;
uint8_t g_WorkCount = 0U;
const LED_Attribute_st LED_Attribute[LED_Max] = const LED_Attribute_st LED_Attribute[LED_Max] =
{ {
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */ /* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
...@@ -138,6 +140,8 @@ void Telltales_Init(void) ...@@ -138,6 +140,8 @@ void Telltales_Init(void)
g_ReadyCount = 0U; g_ReadyCount = 0U;
g_ChgModeStatus = 0U; g_ChgModeStatus = 0U;
g_ChgModeCount = 0U; g_ChgModeCount = 0U;
g_WorkStatus = 0U;
g_WorkCount = 0U;
Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara); Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara);
} }
...@@ -706,28 +710,54 @@ static void LED_External_Discharge_Execution(Tellib_uint16_t led_status) ...@@ -706,28 +710,54 @@ static void LED_External_Discharge_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_Engine_Works_Judgement(void) static Tellib_uint16_t LED_Engine_Works_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_WorkStatus != 2U) && (g_WorkCount >= 3U))
// } {
// else g_WorkStatus = 2U;
// { }
// LED_STATE = 0; else if ((g_WorkStatus != 3U) && (g_WorkCount >= 3U))
// } {
g_WorkStatus = 3U;
}
else if ((g_WorkStatus != 4U) && (g_WorkCount >= 3U))
{
g_WorkStatus = 4U;
}
else if ((g_WorkStatus != 0U) && (g_WorkCount >= 3U))
{
g_WorkStatus = 0U;
}
if ((g_WorkStatus == 2U) || (g_WorkStatus == 3U) || (g_WorkStatus == 4U))
{
LED_STATE = 1U;
}
else
{
LED_STATE = 0U;
}
#endif
return LED_STATE; return LED_STATE;
} }
static void LED_Engine_Works_Execution(Tellib_uint16_t led_status) static void LED_Engine_Works_Execution(Tellib_uint16_t led_status)
{ {
if (led_status == 1u) #if (PART_NUMBER == G54_A01)
{
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); if (led_status == 1u)
// SEG_SET_LED_STS(1,1); {
} LED_Driver_Channel_Set(LampChannel_0, LampCh0_16_Engine_Works_W, LED_ON);
else SEG_SET_LED_STS(SEG_LED_engine_Burn,1);
{ }
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); else
// SEG_SET_LED_STS(1,0); {
} LED_Driver_Channel_Set(LampChannel_0, LampCh0_16_Engine_Works_W, LED_OFF);
SEG_SET_LED_STS(SEG_LED_engine_Burn,0);
}
#endif
} }
static Tellib_uint16_t LED_Bluetooth_Connection_Judgement(void) static Tellib_uint16_t LED_Bluetooth_Connection_Judgement(void)
{ {
......
...@@ -61,7 +61,8 @@ extern uint8_t g_ReadyStatus; ...@@ -61,7 +61,8 @@ extern uint8_t g_ReadyStatus;
extern uint8_t g_ReadyCount; extern uint8_t g_ReadyCount;
extern uint8_t g_ChgModeStatus; extern uint8_t g_ChgModeStatus;
extern uint8_t g_ChgModeCount; extern uint8_t g_ChgModeCount;
extern uint8_t g_WorkStatus;
extern uint8_t g_WorkCount;
// extern Tellib_uint8_t Auto_Start_Stop ; // extern Tellib_uint8_t Auto_Start_Stop ;
void Telltales_Init(void); 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