Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RT_RMR42E
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
时昊
RT_RMR42E
Commits
ab8f130c
Commit
ab8f130c
authored
Feb 21, 2025
by
李冠华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:修改混动车型电池电量逻辑处理
parent
bdbaa735
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
107 additions
and
66 deletions
+107
-66
Data_Soc.c
Firmware/Source/Application/Data_Soc/Data_Soc.c
+107
-66
No files found.
Firmware/Source/Application/Data_Soc/Data_Soc.c
View file @
ab8f130c
...
...
@@ -59,7 +59,16 @@ static void Data_Soc_Battery_Level_Service(void)
Soc
.
Valid1
=
0U
;
}
#else
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x17A_Msg
))
==
CAN_SIG_NORMAL
)
{
Soc
.
Value1
=
Get_CAN_CH0_ID_17A_Sig_MBMS_StatSoc
();
Soc
.
Valid1
=
1U
;
}
else
{
Soc
.
Value1
=
0U
;
Soc
.
Valid1
=
0U
;
}
#endif
if
(
Soc
.
Valid1
!=
0U
)
...
...
@@ -122,6 +131,7 @@ static void Data_Soc_Battery_Level_Service(void)
static
void
Data_Soc_DisplayEffect_Service
(
void
)
{
#if (PART_NUMBER == RMR42E_60)
uint8_t
MBMS_TOTALSigAcc
=
Get_CAN_Num_MBMS_TOTALSigAcc
();
uint8_t
MBMS_TOTALSigCharge
=
Get_CAN_Num_MBMS_TOTALSigCharge
();
uint8_t
MBMS_StatBattWorkState
=
Get_CAN_Num_MBMS_StatBattWorkState
();
...
...
@@ -184,23 +194,21 @@ static void Data_Soc_DisplayEffect_Service(void)
{
if
(
MBMS_StatBattWorkState
==
0x1
)
// 主电池
{
#if (PART_NUMBER == RMR42E_60)
if
(
Soc
.
Act_Seg2
==
1U
)
if
(
Soc
.
Act_Seg2
==
1U
)
{
if
(
FLASH_SYNC_1Hz
)
{
if
(
FLASH_SYNC_1Hz
)
{
Soc
.
Dis_Seg2
=
1U
;
}
else
{
Soc
.
Dis_Seg2
=
0U
;
}
Soc
.
Dis_Seg2
=
1U
;
}
else
{
Soc
.
Dis_Seg2
=
Soc
.
Act_Seg2
;
Soc
.
Dis_Seg2
=
0U
;
}
#endif
}
else
{
Soc
.
Dis_Seg2
=
Soc
.
Act_Seg2
;
}
if
(
++
SOC_Count_Time
>
10U
)
{
SOC_Count_Time
=
0U
;
...
...
@@ -229,62 +237,48 @@ static void Data_Soc_DisplayEffect_Service(void)
Soc
.
Dis_Seg1
=
Soc
.
Act_Seg1
;
}
#if (PART_NUMBER == RMR42E_60)
if
(
++
SOC_Count_Time
>
10U
)
if
(
++
SOC_Count_Time
>
10U
)
{
SOC_Count_Time
=
0U
;
Soc
.
Dis_Seg2
++
;
if
(
Soc
.
Dis_Seg2
>
Soc
.
Act_Seg2
)
{
SOC_Count_Time
=
0U
;
Soc
.
Dis_Seg2
++
;
if
(
Soc
.
Dis_Seg2
>
Soc
.
Act_Seg2
)
{
Soc
.
Dis_Seg2
=
0U
;
}
Soc
.
Dis_Seg2
=
0U
;
}
#endif
}
}
else
if
(
MBMS_StatBattWorkState
==
0x7
)
// 主副电池
{
#if (PART_NUMBER == RMR42E_60)
if
(
++
SOC_Count_Time
>
10U
)
if
(
++
SOC_Count_Time
>
10U
)
{
SOC_Count_Time
=
0U
;
Soc
.
Dis_Seg1
++
;
Soc
.
Dis_Seg2
++
;
if
(
Soc
.
Act_Seg1
>
Soc
.
Act_Seg2
)
{
SOC_Count_Time
=
0U
;
Soc
.
Dis_Seg1
++
;
Soc
.
Dis_Seg2
++
;
if
(
Soc
.
Act_Seg1
>
Soc
.
Act_Seg2
)
{
if
(
Soc
.
Dis_Seg2
>
Soc
.
Act_Seg2
)
{
Soc
.
Dis_Seg2
=
Soc
.
Act_Seg2
;
if
(
Soc
.
Dis_Seg1
>
Soc
.
Act_Seg1
)
{
Soc
.
Dis_Seg1
=
0U
;
Soc
.
Dis_Seg2
=
0U
;
}
}
}
else
if
(
Soc
.
Dis_Seg2
>
Soc
.
Act_Seg2
)
{
Soc
.
Dis_Seg2
=
Soc
.
Act_Seg2
;
if
(
Soc
.
Dis_Seg1
>
Soc
.
Act_Seg1
)
{
Soc
.
Dis_Seg1
=
Soc
.
Act_Seg1
;
if
(
Soc
.
Dis_Seg2
>
Soc
.
Act_Seg2
)
{
Soc
.
Dis_Seg1
=
0U
;
Soc
.
Dis_Seg2
=
0U
;
}
Soc
.
Dis_Seg1
=
0U
;
Soc
.
Dis_Seg2
=
0U
;
}
}
}
#else
if
(
++
SOC_Count_Time
>
10U
)
else
{
SOC_Count_Time
=
0U
;
Soc
.
Dis_Seg1
++
;
if
(
Soc
.
Dis_Seg1
>
Soc
.
Act_Seg1
)
{
Soc
.
Dis_Seg1
=
0U
;
Soc
.
Dis_Seg1
=
Soc
.
Act_Seg1
;
if
(
Soc
.
Dis_Seg2
>
Soc
.
Act_Seg2
)
{
Soc
.
Dis_Seg1
=
0U
;
Soc
.
Dis_Seg2
=
0U
;
}
}
}
#endif
}
}
else
{
...
...
@@ -335,19 +329,62 @@ static void Data_Soc_DisplayEffect_Service(void)
SocPoweroffTime
=
0U
;
}
}
#else
uint8_t
VCUChgMode
=
Get_CAN_CH0_ID_220_Sig_VCU_ChgMode
();
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
((
Get_CAN_Power_State
()
<
KEY_ACC
)
||
(
Common_Get_IG_Sts
()
==
COMMON_POWER_OFF
))
{
if
(
SocPoweroffTime
>=
3600U
)
{
Soc
.
Valid1
=
0U
;
}
else
{
Soc
.
Valid1
=
1U
;
SocPoweroffTime
++
;
}
}
else
{
Soc
.
Valid1
=
1U
;
}
}
else
{
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
System_Indicator_CANFlag
!=
1
))
{
Soc
.
Dis_Seg1
=
Soc
.
Act_Seg1
;
Soc
.
Valid1
=
1U
;
}
else
{
Soc
.
Dis_Seg1
=
0U
;
Soc
.
Valid1
=
0U
;
}
}
#endif
}
static
void
Data_Soc_Battery_Icon_Service
(
void
)
{
#if (PART_NUMBER == RMR42E_60)
uint8_t
MBMSStatBattWorkState
=
0U
;
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
System_Indicator_CANFlag
!=
1
))
{
#if (PART_NUMBER == RMR42E_60)
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
Soc
.
Value1
!=
0U
))
#else
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x17A_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
Soc
.
Value1
!=
0U
))
#endif
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
Soc
.
Value1
!=
0U
))
{
Soc
.
Battery1Icon
=
1U
;
}
...
...
@@ -358,15 +395,10 @@ static void Data_Soc_Battery_Icon_Service(void)
}
else
{
#if (PART_NUMBER == RMR42E_60)
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
))
#else
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x17A_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x220_Msg
))
==
CAN_SIG_NORMAL
))
#endif
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A20_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18203220_Msg
))
==
CAN_SIG_NORMAL
))
{
//
MBMSStatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
MBMSStatBattWorkState
=
Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState
();
if
((
MBMSStatBattWorkState
==
0x1U
)
||
(
MBMSStatBattWorkState
==
0x7U
))
{
Soc
.
Battery1Icon
=
1U
;
...
...
@@ -382,7 +414,7 @@ static void Data_Soc_Battery_Icon_Service(void)
}
}
#if (PART_NUMBER == RMR42E_60)
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
System_Indicator_CANFlag
!=
1
))
{
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18200A21_Msg
))
==
CAN_SIG_NORMAL
)
&&
(
Soc
.
Value2
!=
0U
))
...
...
@@ -414,6 +446,15 @@ static void Data_Soc_Battery_Icon_Service(void)
Soc
.
Battery2Icon
=
0U
;
}
}
#else
if
(
Soc
.
Valid1
==
1U
)
{
Soc
.
Battery1Icon
=
1U
;
}
else
{
Soc
.
Battery1Icon
=
0U
;
}
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment