Commit e154530d authored by 李冠华's avatar 李冠华

feat:增加报文0x16B回调函数,增加混动车型充电指示灯工作逻辑

parent 1492ad5c
...@@ -637,7 +637,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -637,7 +637,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
500ul, 500ul,
0x16Bul, 0x16Bul,
(( void * )0), (( void * )0),
(( void * )0), (CAN_0x16B_Receive),
(( void * )0), (( void * )0),
}, },
{ {
......
...@@ -467,3 +467,38 @@ void CAN_0x220_Receive(uint8_t CopyData []) ...@@ -467,3 +467,38 @@ void CAN_0x220_Receive(uint8_t CopyData [])
#endif #endif
} }
void CAN_0x16B_Receive(uint8_t CopyData [])
{
#if (PART_NUMBER == G54_A01)
uint8_t u8Signal = Get_CAN_CH0_ID_16B_Sig_MBMS_SafeBattWorkState();
if ((u8Signal == 1U) && (g_ChgModeStatus != 1U))
{
if (g_ChgModeCount < 3U)
{
g_ChgModeCount++;
}
}
else if ((u8Signal == 3U) && (g_ChgModeStatus != 2U))
{
if (g_ChgModeCount < 3U)
{
g_ChgModeCount++;
}
}
else if ((u8Signal != 1U) && (u8Signal != 3U) && (g_ChgModeStatus != 0U))
{
if (g_ChgModeCount < 3U)
{
g_ChgModeCount++;
}
}
else
{
g_ChgModeCount = 0U;
}
#endif
}
...@@ -42,5 +42,6 @@ extern void CAN_0x225_Receive(uint8_t CopyData []); ...@@ -42,5 +42,6 @@ extern void CAN_0x225_Receive(uint8_t CopyData []);
extern void CAN_0x234_Receive(uint8_t CopyData []); 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 []);
#endif #endif
...@@ -78,6 +78,8 @@ uint8_t g_KeyStatus = 0U; ...@@ -78,6 +78,8 @@ uint8_t g_KeyStatus = 0U;
uint8_t g_KeyCount = 0U; uint8_t g_KeyCount = 0U;
uint8_t g_ReadyStatus = 0U; uint8_t g_ReadyStatus = 0U;
uint8_t g_ReadyCount = 0U; uint8_t g_ReadyCount = 0U;
uint8_t g_ChgModeStatus = 0U;
uint8_t g_ChgModeCount = 0U;
const LED_Attribute_st LED_Attribute[LED_Max] = const LED_Attribute_st LED_Attribute[LED_Max] =
{ {
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */ /* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
...@@ -134,6 +136,8 @@ void Telltales_Init(void) ...@@ -134,6 +136,8 @@ void Telltales_Init(void)
g_KeyCount = 0U; g_KeyCount = 0U;
g_ReadyStatus = 0U; g_ReadyStatus = 0U;
g_ReadyCount = 0U; g_ReadyCount = 0U;
g_ChgModeStatus = 0U;
g_ChgModeCount = 0U;
Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara); Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara);
} }
...@@ -515,27 +519,54 @@ static void LED_Key_Access_Execution(Tellib_uint16_t led_status) ...@@ -515,27 +519,54 @@ static void LED_Key_Access_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_Battery_Charging_Judgement(void) static Tellib_uint16_t LED_Battery_Charging_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_TOTALSigAcc(); #if (PART_NUMBER == RMR42E_60)
Tellib_uint8_t Signal2 = Get_CAN_Num_MBMS_TOTALSigCharge(); Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_TOTALSigAcc();
Tellib_uint8_t Signal3 = Get_CAN_Power_State(); Tellib_uint8_t Signal2 = Get_CAN_Num_MBMS_TOTALSigCharge();
if ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL)) Tellib_uint8_t Signal3 = Get_CAN_Power_State();
{ if ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL))
if (((Signal1 == 0x1) || (Signal1 == 0x0)) && (Signal2 == 0X1))
{ {
if ((Signal3 == CHRG_PLUGIN) || (Signal3 == CHRGEND)) if (((Signal1 == 0x1) || (Signal1 == 0x0)) && (Signal2 == 0X1))
{ {
LED_STATE = 2; if ((Signal3 == CHRG_PLUGIN) || (Signal3 == CHRGEND))
{
LED_STATE = 2;
}
else if (Signal3 == CHRGING)
{
LED_STATE = 1;
}
} }
else if (Signal3 == CHRGING) else
{ {
LED_STATE = 1; LED_STATE = 0;
} }
} }
else #else
Tellib_uint8_t Signal1 = Get_CAN_CH0_ID_220_Sig_VCU_ChgMode();
if (Signal1 == 1U)
{ {
LED_STATE = 0; if ((g_ChgModeStatus != 1U) && (g_ChgModeCount >= 3U))
{
g_ChgModeStatus = 1U;
}
else if ((g_ChgModeStatus != 2U) && (g_ChgModeCount >= 3U))
{
g_ChgModeStatus = 2U;
}
else if ((g_ChgModeStatus != 0U) && (g_ChgModeCount >= 3U))
{
g_ChgModeStatus = 0U;
}
LED_STATE = (Tellib_uint16_t) g_ChgModeStatus;
} }
} else
{
LED_STATE = 0U;
}
#endif
return LED_STATE; return LED_STATE;
} }
......
...@@ -59,6 +59,8 @@ extern uint8_t g_KeyStatus; ...@@ -59,6 +59,8 @@ extern uint8_t g_KeyStatus;
extern uint8_t g_KeyCount; extern uint8_t g_KeyCount;
extern uint8_t g_ReadyStatus; extern uint8_t g_ReadyStatus;
extern uint8_t g_ReadyCount; extern uint8_t g_ReadyCount;
extern uint8_t g_ChgModeStatus;
extern uint8_t g_ChgModeCount;
// extern Tellib_uint8_t Auto_Start_Stop ; // 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