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
8496e982
Commit
8496e982
authored
Feb 11, 2025
by
李冠华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🦄
refactor:将行驶挡位处理逻辑从显示逻辑中独立出来
parent
19bc2499
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
28 deletions
+64
-28
Data_Gear.c
Firmware/Source/Application/Driving_Information/Data_Gear.c
+53
-0
Data_Gear.h
Firmware/Source/Application/Driving_Information/Data_Gear.h
+6
-3
GUI_Display.c
Firmware/Source/Application/GUI_Display/GUI_Display.c
+4
-25
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+1
-0
No files found.
Firmware/Source/Application/Driving_Information/Data_Gear.c
View file @
8496e982
...
...
@@ -48,7 +48,35 @@ void Data_Gear_Cutterhead_Service(void)
void
Data_Gear_Service
(
void
)
{
uint8_t
Signal1
=
Get_CAN_Num_MMCU_TravelSpeedGear
();
uint8_t
Signal2
=
Get_CAN_Num_MMCU_ParkingGearState
();
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
Get_CAN_Power_State
()
>=
KEY_ACC
)
&&
(
Get_CAN_Power_State
()
<
CHRGEND
)
&&
(
System_Indicator_CANFlag
!=
1
))
{
if
(
Signal2
!=
0x1
)
{
if
((
Signal1
==
0x1
)
||
(
Signal1
==
0x2
))
{
Gear
.
GearNum
=
Signal1
;
Gear
.
GearValid
=
1U
;
}
else
{
Gear
.
GearNum
=
Gear_OFF
;
Gear
.
GearValid
=
1U
;
}
}
else
{
Gear
.
GearNum
=
Gear_P
;
Gear
.
GearValid
=
1U
;
}
}
else
{
Gear
.
GearNum
=
0U
;
Gear
.
GearValid
=
0U
;
}
}
/******************************************************************************
...
...
@@ -77,3 +105,28 @@ uint8_t Get_Gear_Cutterhead_Valid(void)
return
Gear
.
CutterheadValid
;
}
/******************************************************************************
函数名:Get_Gear_Value
功 能:获取行驶挡位数函数
参 数:无
返回值:Gear.GearNum; 0--P挡
******************************************************************************
注 意:该函数必须每 ms被调用一次
******************************************************************************/
uint8_t
Get_Gear_Value
(
void
)
{
return
Gear
.
GearNum
;
}
/******************************************************************************
函数名:Get_Gear_Cutterhead_Valid
功 能:获取行驶挡位状态函数
参 数:无
返回值:Gear.CutterheadValid 0--不显示,1--常显,2--闪烁
******************************************************************************
注 意:该函数必须每 ms被调用一次
******************************************************************************/
uint8_t
Get_Gear_Valid
(
void
)
{
return
Gear
.
GearValid
;
}
Firmware/Source/Application/Driving_Information/Data_Gear.h
View file @
8496e982
...
...
@@ -7,9 +7,10 @@
typedef
struct
//__attribute__((aligned(4)))
{
uint8_t
CutterHeadNum
;
//燃油格数
uint8_t
CutterheadValid
;
//燃油有效状态
uint8_t
GearNum
;
/*燃油状态计数*/
uint8_t
CutterHeadNum
;
//刀盘挡位值
uint8_t
CutterheadValid
;
//刀盘挡位有效状态
uint8_t
GearNum
;
/*行驶挡位值*/
uint8_t
GearValid
;
/*行驶挡位有效状态*/
}
GearStruct_st_t
;
...
...
@@ -20,6 +21,8 @@ extern void Data_Gear_Cutterhead_Service(void);
extern
void
Data_Gear_Service
(
void
);
extern
uint8_t
Get_Gear_Cutterhead_Value
(
void
);
extern
uint8_t
Get_Gear_Cutterhead_Valid
(
void
);
extern
uint8_t
Get_Gear_Value
(
void
);
extern
uint8_t
Get_Gear_Valid
(
void
);
#endif
Firmware/Source/Application/GUI_Display/GUI_Display.c
View file @
8496e982
...
...
@@ -75,31 +75,10 @@ void Gauge_Cutterhead_Gear_Display(void)
void
Gauge_Gears_Display
(
void
)
{
uint8_t
Signal1
=
Get_CAN_Num_MMCU_TravelSpeedGear
();
uint8_t
Signal2
=
Get_CAN_Num_MMCU_ParkingGearState
();
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if
((
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
&&
(
Charge_OFF_Flag
==
0
)
&&
(
Get_CAN_Power_State
()
!=
KEY_OFF
)
&&
(
System_Indicator_CANFlag
!=
1
))
{
if
(
Signal2
!=
0x1
)
{
if
((
Signal1
==
0x1
)
||
(
Signal1
==
0x2
))
{
SEG_SET_GEAR
(
1
,
Signal1
,
0
);
}
else
{
SEG_SET_GEAR
(
1
,
Gear_OFF
,
0
);
}
}
else
{
SEG_SET_GEAR
(
1
,
Gear_P
,
0
);
}
}
else
{
SEG_SET_GEAR
(
0
,
Signal1
,
0
);
}
uint8_t
GearValue
=
Get_Gear_Value
();
uint8_t
GearValid
=
Get_Gear_Valid
();
SEG_SET_GEAR
(
GearValid
,
GearValue
,
0
);
}
void
Gauge_EleDial_AllSOC_Display
(
void
)
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
8496e982
...
...
@@ -27,6 +27,7 @@ void Sys_5ms_Tasks(void)
{
Flash_Sync_Signal_Generation_Service
();
Data_Gear_Cutterhead_Service
();
Data_Gear_Service
();
}
void
Sys_10ms_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