Commit 86d2380b authored by 李冠华's avatar 李冠华

feat:修改充电状态电量条效果,从流水特效改为最后一格闪烁

parent 98f7f951
......@@ -6,6 +6,7 @@ SocStruct_st_t Soc;
uint8_t SOC_Count_Time = 0;
uint8_t g_Msg0x17AFlag = 0U;
uint16_t SocPoweroffTime = 0;
uint8_t g_SOCChargingState = 0U;
static void Data_Soc_Battery_Level_Service(void);
static void Data_Soc_DisplayEffect_Service(void);
......@@ -28,6 +29,7 @@ void Data_Soc_KL30_Init(void)
Soc.AllSocValid = 0U;
SocPoweroffTime = 0U;
g_Msg0x17AFlag = 0U;
g_SOCChargingState = 0U;
}
void Data_Soc_KL15_Init(void)
......@@ -356,15 +358,34 @@ static void Data_Soc_DisplayEffect_Service(void)
if (VCUChgMode == 1U)
{
if (++SOC_Count_Time > 10U)
{
SOC_Count_Time = 0U;
Soc.Dis_Seg1 ++;
if (Soc.Dis_Seg1 > Soc.Act_Seg1)
{
Soc.Dis_Seg1 = 0U;
}
}
/*----------电量条充电流水效果(功能删除)----------------*/
// if (++SOC_Count_Time > 10U)
// {
// SOC_Count_Time = 0U;
// Soc.Dis_Seg1 ++;
// if (Soc.Dis_Seg1 > Soc.Act_Seg1)
// {
// Soc.Dis_Seg1 = 0U;
// }
// }
// if (Get_CAN_Power_State() == PKEY_ON)
// {
// if (SocPoweroffTime >= 3600U)
// {
// Soc.Valid1 = 0U;
// }
// else
// {
// SocPoweroffTime ++;
// }
// }
// else if(Get_CAN_Power_State() == KEY_OFF)
// {
// Soc.Valid1 = 0U;
// }
/*------------------------------------------------------*/
Soc.Dis_Seg1 = Soc.Act_Seg1;
g_SOCChargingState = 1U;
if (Get_CAN_Power_State() == PKEY_ON)
{
if (SocPoweroffTime >= 3600U)
......@@ -380,9 +401,11 @@ static void Data_Soc_DisplayEffect_Service(void)
{
Soc.Valid1 = 0U;
}
}
else
{
g_SOCChargingState = 0U;
if (Get_CAN_Power_State() == KEY_ACC)
{
Soc.Dis_Seg1 = Soc.Act_Seg1;
......@@ -692,3 +715,16 @@ uint8_t Get_EleDial_AllSOC_lenth(void)
}
return num;
}
/******************************************************************************
函数名:Get_SOC_Charging_State
功 能:获取充电状态状态函数
参 数:无
返回值:_SOCChargingState 0--非充电,1--充电
******************************************************************************
注 意:该函数必须每 ms被调用一次
******************************************************************************/
uint8_t Get_SOC_Charging_State(void)
{
return g_SOCChargingState;
}
......@@ -52,6 +52,7 @@ extern uint8_t Get_Soc2_Battery_Icon(void);
extern uint8_t Get_AllSocValue(void);
extern uint8_t Get_AllSocValid(void);
extern uint8_t Get_EleDial_AllSOC_lenth(void);
extern uint8_t Get_SOC_Charging_State(void);
#endif
......@@ -703,7 +703,7 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG)
#if (PART_NUMBER == RMR42E_60)
if ((m_SEG == 1) && (Common_GetIgnOnTime() >= 1500) && (SOC_charge_seg_Flag != 1))
#else
if ((m_SEG == 1) && (Common_GetIgnOnTime() >= 1500) && (SOC_charge_seg_Flag != 1) && (Get_CAN_CH0_ID_220_Sig_VCU_ChgMode() != 1U))
if ((m_SEG == 1) && (Common_GetIgnOnTime() >= 1500) && (Get_SOC_Charging_State() != 1U))
#endif
{
if (FLASH_SYNC_1Hz)
......@@ -717,7 +717,7 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG)
}
else
{
switch (m_SEG)
switch (m_SEG - 1U)
{
case 10u:
......@@ -745,6 +745,157 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG)
default:
break;
}
if (Get_SOC_Charging_State() == 1U)
{
switch (m_SEG)
{
case 10u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG136 = IC_SEG_ON;
}
else
{
IC1_SEG136 = IC_SEG_GREY;
}
break;
case 9u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG137 = IC_SEG_ON;
}
else
{
IC1_SEG137 = IC_SEG_GREY;
}
break;
case 8u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG138 = IC_SEG_ON;
}
else
{
IC1_SEG138 = IC_SEG_GREY;
}
break;
case 7u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG143 = IC_SEG_ON;
}
else
{
IC1_SEG143 = IC_SEG_GREY;
}
break;
case 6u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG144 = IC_SEG_ON;
}
else
{
IC1_SEG144 = IC_SEG_GREY;
}
break;
case 5u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG145 = IC_SEG_ON;
}
else
{
IC1_SEG145 = IC_SEG_GREY;
}
break;
case 4u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG146 = IC_SEG_ON;
}
else
{
IC1_SEG146 = IC_SEG_GREY;
}
break;
case 3u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG147 = IC_SEG_ON;
}
else
{
IC1_SEG147 = IC_SEG_GREY;
}
break;
case 2u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG148 = IC_SEG_ON;
}
else
{
IC1_SEG148 = IC_SEG_GREY;
}
break;
case 1u:
if (FLASH_SYNC_1Hz)
{
IC1_SEG135 = IC_SEG_ON;
}
else
{
IC1_SEG135 = IC_SEG_GREY;
}
break;
case 0u:
break;
default:
break;
}
}
else
{
switch (m_SEG)
{
case 10u:
IC1_SEG136 = IC_SEG_ON;
break;
case 9u:
IC1_SEG137 = IC_SEG_ON;
break;
case 8u:
IC1_SEG138 = IC_SEG_ON;
break;
case 7u:
IC1_SEG143 = IC_SEG_ON;
break;
case 6u:
IC1_SEG144 = IC_SEG_ON;
break;
case 5u:
IC1_SEG145 = IC_SEG_ON;
break;
case 4u:
IC1_SEG146 = IC_SEG_ON;
break;
case 3u:
IC1_SEG147 = IC_SEG_ON;
break;
case 2u:
IC1_SEG148 = IC_SEG_ON;
break;
case 1u:
IC1_SEG135 = IC_SEG_ON;
break;
case 0u:
break;
default:
break;
}
}
}
}
else
......
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