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
6d6245fd
Commit
6d6245fd
authored
Feb 19, 2025
by
李冠华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:完善燃油数据处理功能
parent
4ab79f59
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
9 deletions
+58
-9
CAN_CH0_CAN_Communication_Matrix.c
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
+1
-1
Data_Fuel.c
Firmware/Source/Application/Data_Fuel/Data_Fuel.c
+51
-8
Data_Fuel.h
Firmware/Source/Application/Data_Fuel/Data_Fuel.h
+4
-0
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+1
-0
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+1
-0
No files found.
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
View file @
6d6245fd
...
@@ -687,7 +687,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
...
@@ -687,7 +687,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
500ul
,
500ul
,
0x18Eul
,
0x18Eul
,
((
void
*
)
0
),
((
void
*
)
0
),
(
(
void
*
)
0
),
(
MsgID_0x18E_Receive
),
((
void
*
)
0
),
((
void
*
)
0
),
},
},
{
{
...
...
Firmware/Source/Application/Data_Fuel/Data_Fuel.c
View file @
6d6245fd
...
@@ -5,7 +5,10 @@ FuelStruct_st_t Fuel;
...
@@ -5,7 +5,10 @@ FuelStruct_st_t Fuel;
void
Data_Fuel_KL30_Init
(
void
)
void
Data_Fuel_KL30_Init
(
void
)
{
{
Fuel
.
FuelSeg
=
0U
;
Fuel
.
FuelSegDis
=
0U
;
Fuel
.
FuelStatusCount
=
0U
;
Fuel
.
FuelValid
=
0U
;
}
}
void
Data_Fuel_KL15_Init
(
void
)
void
Data_Fuel_KL15_Init
(
void
)
...
@@ -15,21 +18,37 @@ void Data_Fuel_KL15_Init(void)
...
@@ -15,21 +18,37 @@ void Data_Fuel_KL15_Init(void)
void
MsgID_0x18E_Receive
(
void
)
void
MsgID_0x18E_Receive
(
void
)
{
{
Fuel
.
FuelStatusCount
++
;
if
((
Fuel
.
FuelSeg
!=
Fuel
.
FuelSegDis
)
&&
(
Fuel
.
FuelStatusCount
>=
3U
))
{
Fuel
.
FuelSegDis
=
Fuel
.
FuelSeg
;
Fuel
.
FuelStatusCount
=
0U
;
}
else
if
((
Fuel
.
FuelSeg
!=
Fuel
.
FuelSegDis
)
&&
(
Fuel
.
FuelStatusCount
<
3U
))
{
Fuel
.
FuelStatusCount
++
;
}
else
{
Fuel
.
FuelStatusCount
=
0U
;
}
}
}
void
Data_Fuel_Service
(
void
)
void
Data_Fuel_Service
(
void
)
{
{
uint8_t
FuelRemainLevel
=
0U
;
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18E_Msg
))
==
CAN_SIG_NORMAL
)
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
Co_Can_ConvertSubID_CAN_CH0
(
CAN_CH0_ID_CAN_0x18E_Msg
))
==
CAN_SIG_NORMAL
)
{
{
Fuel
RemainLevel
=
Get_CAN_CH0_ID_18E_Sig_EMS_FuelRemainLevel
();
Fuel
.
FuelSeg
=
Get_CAN_CH0_ID_18E_Sig_EMS_FuelRemainLevel
();
Fuel
.
FuelValid
=
1U
;
Fuel
.
FuelValid
=
1U
;
if
(
Fuel
.
FuelSeg
>
8U
)
{
Fuel
.
FuelSeg
=
8U
;
}
}
}
else
else
{
{
Fuel
.
FuelValid
=
0U
;
Fuel
.
FuelValid
=
0U
;
Fuel
.
FuelStatusCount
=
0U
;
}
}
}
}
...
@@ -44,14 +63,14 @@ void Data_Fuel_Service(void)
...
@@ -44,14 +63,14 @@ void Data_Fuel_Service(void)
******************************************************************************/
******************************************************************************/
uint8_t
Get_FuelSeg_Display
(
void
)
uint8_t
Get_FuelSeg_Display
(
void
)
{
{
return
Fuel
.
FuelSeg
;
return
Fuel
.
FuelSeg
Dis
;
}
}
/******************************************************************************
/******************************************************************************
函数名:Get_
Soc2Num_Display
函数名:Get_
FuelStatus_Valid
功 能:获取
电量表2显示电量值
函数
功 能:获取
燃油表有效状态
函数
参 数:无
参 数:无
返回值:
显示的电量值 x1
返回值:
Fuel.FuelValid 0--无效,1--有效
******************************************************************************
******************************************************************************
注 意:该函数必须每 ms被调用一次
注 意:该函数必须每 ms被调用一次
******************************************************************************/
******************************************************************************/
...
@@ -60,3 +79,27 @@ uint8_t Get_FuelStatus_Valid(void)
...
@@ -60,3 +79,27 @@ uint8_t Get_FuelStatus_Valid(void)
return
Fuel
.
FuelValid
;
return
Fuel
.
FuelValid
;
}
}
/******************************************************************************
函数名:Get_FuelPilotLamp_Status
功 能:获取燃油指示灯状态函数
参 数:无
返回值:LampStatus 0--白色,1--黄色,2--黄色闪烁
******************************************************************************
注 意:该函数必须每 ms被调用一次
******************************************************************************/
uint8_t
Get_FuelPilotLamp_Status
(
void
)
{
uint8_t
LampStatus
=
0U
;
if
((
Fuel
.
FuelValid
==
1U
)
&&
(
Fuel
.
FuelSegDis
==
1U
))
{
LampStatus
=
1U
;
}
else
if
((
Fuel
.
FuelValid
==
1U
)
&&
(
Fuel
.
FuelSegDis
==
0U
))
{
LampStatus
=
2U
;
}
return
LampStatus
;
}
Firmware/Source/Application/Data_Fuel/Data_Fuel.h
View file @
6d6245fd
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
typedef
struct
//__attribute__((aligned(4)))
typedef
struct
//__attribute__((aligned(4)))
{
{
uint8_t
FuelSeg
;
//燃油格数
uint8_t
FuelSeg
;
//燃油格数
uint8_t
FuelSegDis
;
//燃油显示格数
uint8_t
FuelValid
;
//燃油有效状态
uint8_t
FuelValid
;
//燃油有效状态
uint8_t
FuelStatusCount
;
/*燃油状态计数*/
uint8_t
FuelStatusCount
;
/*燃油状态计数*/
...
@@ -19,5 +20,8 @@ extern void Data_Fuel_KL15_Init(void);
...
@@ -19,5 +20,8 @@ extern void Data_Fuel_KL15_Init(void);
extern
void
MsgID_0x18E_Receive
(
void
);
extern
void
MsgID_0x18E_Receive
(
void
);
extern
void
Data_Fuel_Service
(
void
);
extern
void
Data_Fuel_Service
(
void
);
extern
uint8_t
Get_FuelSeg_Display
(
void
);
extern
uint8_t
Get_FuelStatus_Valid
(
void
);
extern
uint8_t
Get_FuelPilotLamp_Status
(
void
);
#endif
#endif
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
6d6245fd
...
@@ -75,6 +75,7 @@ static void Power_KL30_Init(void)
...
@@ -75,6 +75,7 @@ static void Power_KL30_Init(void)
Data_Soc_KL30_Init
();
Data_Soc_KL30_Init
();
Data_Time_KL30_Init
();
Data_Time_KL30_Init
();
Data_Gear_KL30_Init
();
Data_Gear_KL30_Init
();
Data_Fuel_KL30_Init
();
}
}
extern
uint32_t
PowerIgnOffTimeLine
;
extern
uint32_t
PowerIgnOffTimeLine
;
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
6d6245fd
...
@@ -40,6 +40,7 @@ void Sys_10ms_Tasks(void)
...
@@ -40,6 +40,7 @@ void Sys_10ms_Tasks(void)
void
Sys_20ms_Tasks
(
void
)
void
Sys_20ms_Tasks
(
void
)
{
{
Data_Fuel_Service
();
}
}
void
Sys_50ms_Tasks
(
void
)
void
Sys_50ms_Tasks
(
void
)
...
...
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