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
04f42c2f
Commit
04f42c2f
authored
Jul 10, 2024
by
郑萍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:电量显示将电量处理成格数并向上取整
parent
03b9184e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
19 deletions
+45
-19
userdefine.h
...BAT32A239/MDK_ARM/RTE/Device/BAT32G139GK64FB/userdefine.h
+1
-1
GUI_Display.c
Firmware/Source/Application/GUI_Display/GUI_Display.c
+42
-17
GUI_Display.h
Firmware/Source/Application/GUI_Display/GUI_Display.h
+2
-1
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/RTE/Device/BAT32G139GK64FB/userdefine.h
View file @
04f42c2f
...
...
@@ -16,7 +16,7 @@ User definitions
***********************************************************************************************************************/
#ifndef __TYPEDEF__
#define HAS_BOOTLOADER (
1
u) // 仅仿真App时设置为0
#define HAS_BOOTLOADER (
0
u) // 仅仿真App时设置为0
#define APP_BASE (0x00008000ul)
typedef
unsigned
short
MD_STATUS
;
...
...
Firmware/Source/Application/GUI_Display/GUI_Display.c
View file @
04f42c2f
...
...
@@ -13,10 +13,10 @@ void Gauge_Power_SOC_pull_Display(void)
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
&&
Charge_OFF_Flag
==
0
)
{
uint8_t
SOC_1_Count
=
Get_CAN_Num_MBMS_Soc
();
uint8_t
SOC_2_Count
=
Get_CAN_Num_SBMS_Soc
();
SEG_SET_EleDial_1SOC
(
1
,
SOC_1_Count
);
SEG_SET_EleDial_2SOC
(
1
,
SOC_2_Count
);
uint8_t
Current_1_Grid
=
Get_CAN_Num_MBMS_Soc_1_Grid
();
uint8_t
Current_2_Grid
=
Get_CAN_Num_SBMS_Soc_2_Grid
();
SEG_SET_EleDial_1SOC
(
1
,
Current_1_Grid
);
SEG_SET_EleDial_2SOC
(
1
,
Current_2_Grid
);
}
else
{
...
...
@@ -78,6 +78,30 @@ void Gauge_Gears_Display(void)
SEG_SET_GEAR
(
0
,
Signal1
,
0
);
}
}
uint8_t
Get_CAN_Num_MBMS_Soc_1_Grid
(
void
)
{
uint8_t
num
=
0
;
uint8_t
Current_SOC_1_Num
=
Get_CAN_Num_MBMS_Soc
();
num
=
(
Current_SOC_1_Num
/
10
);
if
((
Current_SOC_1_Num
%
10
)
!=
0
)
{
num
++
;
}
return
num
;
}
uint8_t
Get_CAN_Num_SBMS_Soc_2_Grid
(
void
)
{
uint8_t
num
=
0
;
uint8_t
Current_SOC_2_Num
=
Get_CAN_Num_SBMS_Soc
();
num
=
(
Current_SOC_2_Num
/
10
);
if
((
Current_SOC_2_Num
%
10
)
!=
0
)
{
num
++
;
}
return
num
;
}
uint8_t
SOC1_Count
=
0
;
uint8_t
SOC2_Count
=
0
;
void
Gauge_Power_SOC_CHAGING_Display
(
void
)
...
...
@@ -88,8 +112,9 @@ void Gauge_Power_SOC_CHAGING_Display(void)
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
{
uint8_t
SOC_1_Count
=
Get_CAN_Num_MBMS_Soc
();
uint8_t
SOC_2_Count
=
Get_CAN_Num_SBMS_Soc
();
uint8_t
Current_1_Grid
=
Get_CAN_Num_MBMS_Soc_1_Grid
();
uint8_t
Current_2_Grid
=
Get_CAN_Num_SBMS_Soc_2_Grid
();
if
((
MBMS_TOTALSigAcc
==
0x1
&&
MBMS_TOTALSigCharge
==
0x1
)
||
(
MBMS_TOTALSigAcc
==
0x0
&&
MBMS_TOTALSigCharge
==
0x1
))
// 上电充电
{
if
(
MBMS_StatBattWorkState
==
0x1
)
// 主电池
...
...
@@ -100,13 +125,13 @@ void Gauge_Power_SOC_CHAGING_Display(void)
SEG_SET_EleDial_1SOC
(
1
,
SOC1_Count
);
SOC1_Count
++
;
if
(
SOC1_Count
>
SOC_1_Count
)
if
(
SOC1_Count
>
Current_1_Grid
)
{
SOC1_Count
=
0
;
}
}
SEG_SET_EleDial_2SOC
(
1
,
SOC_2_Count
);
SEG_SET_EleDial_2SOC
(
1
,
Current_2_Grid
);
}
else
if
(
MBMS_StatBattWorkState
==
0x4
)
// 副电池
{
...
...
@@ -116,13 +141,13 @@ void Gauge_Power_SOC_CHAGING_Display(void)
SEG_SET_EleDial_2SOC
(
1
,
SOC2_Count
);
SOC2_Count
++
;
if
(
SOC2_Count
>
SOC_2_Count
)
if
(
SOC2_Count
>
Current_2_Grid
)
{
SOC2_Count
=
0
;
}
}
SEG_SET_EleDial_1SOC
(
1
,
SOC_1_Count
);
SEG_SET_EleDial_1SOC
(
1
,
Current_1_Grid
);
}
else
if
(
MBMS_StatBattWorkState
==
0x7
)
// 主副电池
{
...
...
@@ -134,12 +159,12 @@ void Gauge_Power_SOC_CHAGING_Display(void)
SEG_SET_EleDial_2SOC
(
1
,
SOC2_Count
);
SOC1_Count
++
;
SOC2_Count
++
;
if
(
SOC_1_Count
>
SOC_2_Count
)
if
(
Current_1_Grid
>
Current_2_Grid
)
{
if
(
SOC2_Count
>
SOC_2_Count
)
if
(
SOC2_Count
>
Current_2_Grid
)
{
SOC2_Count
--
;
if
(
SOC1_Count
>
SOC_1_Count
)
if
(
SOC1_Count
>
Current_1_Grid
)
{
SOC1_Count
=
0
;
SOC2_Count
=
0
;
...
...
@@ -148,10 +173,10 @@ void Gauge_Power_SOC_CHAGING_Display(void)
}
else
{
if
(
SOC1_Count
>
SOC_1_Count
)
if
(
SOC1_Count
>
Current_1_Grid
)
{
SOC1_Count
--
;
if
(
SOC2_Count
>
SOC_2_Count
)
if
(
SOC2_Count
>
Current_2_Grid
)
{
SOC1_Count
=
0
;
SOC2_Count
=
0
;
...
...
@@ -162,8 +187,8 @@ void Gauge_Power_SOC_CHAGING_Display(void)
}
else
{
SEG_SET_EleDial_1SOC
(
1
,
SOC_1_Count
);
SEG_SET_EleDial_2SOC
(
1
,
SOC_2_Count
);
SEG_SET_EleDial_1SOC
(
1
,
Current_1_Grid
);
SEG_SET_EleDial_2SOC
(
1
,
Current_2_Grid
);
}
}
if
(
MBMS_TOTALSigAcc
==
0x0
&&
MBMS_TOTALSigCharge
==
0x1
)
// 下电充电
...
...
Firmware/Source/Application/GUI_Display/GUI_Display.h
View file @
04f42c2f
...
...
@@ -70,6 +70,7 @@ void BUZZER_Init(void);
uint8_t
Get_Clock_All_lenth
(
void
);
uint8_t
Get_EleDial_AllSOC_lenth
(
void
);
uint8_t
Get_Clockonetime_lenth
(
void
);
uint8_t
Get_CAN_Num_SBMS_Soc_2_Grid
(
void
);
uint8_t
Get_CAN_Num_MBMS_Soc_1_Grid
(
void
);
#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