Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
TianYing_ty100
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
TY
TianYing_ty100
Commits
b2121838
Commit
b2121838
authored
Jun 26, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:43125 【天鹰TY100】【车速数值】车速遍历缺值
parent
f227c404
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
15 deletions
+122
-15
Data_VSpeed.c
Firmware/Source/Application/Data_VSpeed/Data_VSpeed.c
+118
-4
GUI_Display.c
Firmware/Source/Application/GUI_Display/GUI_Display.c
+4
-11
No files found.
Firmware/Source/Application/Data_VSpeed/Data_VSpeed.c
View file @
b2121838
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
static
uint16_t
DataVSpeedActual
;
static
uint16_t
DataVSpeedActual
;
static
uint16_t
DataVSpeedDisp
;
static
uint16_t
DataVSpeedDisp
;
static
uint32_t
DataVSpeedTarget
;
static
uint16_t
DataVSpeedHysteresis
;
static
uint16_t
DataVSpeedHysteresis
;
static
uint8_t
DataVSpeedValid
;
static
uint8_t
DataVSpeedValid
;
// static uint16_t DataVSpeedDisp_Mile;
// static uint16_t DataVSpeedDisp_Mile;
...
@@ -34,6 +35,7 @@ void Data_Vehicle_Speed_KL30_Init(void)
...
@@ -34,6 +35,7 @@ void Data_Vehicle_Speed_KL30_Init(void)
DataVSPeedDamping
.
Dir
=
DATA_APPR_DIR_INC
;
DataVSPeedDamping
.
Dir
=
DATA_APPR_DIR_INC
;
DataVSpeedSampler
.
Timer1
=
0
;
DataVSpeedSampler
.
Timer1
=
0
;
DataVSpeedSampler
.
Timer
=
0
;
DataVSpeedSampler
.
Timer
=
0
;
DataVSpeedTarget
=
0
;
}
}
/******************************************************************************
/******************************************************************************
...
@@ -53,6 +55,7 @@ void Data_Vehicle_Speed_Wakeup_Init(void)
...
@@ -53,6 +55,7 @@ void Data_Vehicle_Speed_Wakeup_Init(void)
DataVSPeedDamping
.
Dir
=
DATA_APPR_DIR_INC
;
DataVSPeedDamping
.
Dir
=
DATA_APPR_DIR_INC
;
DataVSpeedSampler
.
Timer1
=
0
;
DataVSpeedSampler
.
Timer1
=
0
;
DataVSpeedSampler
.
Timer
=
0
;
DataVSpeedSampler
.
Timer
=
0
;
DataVSpeedTarget
=
0
;
}
}
/******************************************************************************
/******************************************************************************
...
@@ -120,8 +123,8 @@ void Data_Vehicle_Speed_Processing_Service(void)
...
@@ -120,8 +123,8 @@ void Data_Vehicle_Speed_Processing_Service(void)
VSpeed
=
DataVSpeedSampler
.
Buffer
[
1
];
VSpeed
=
DataVSpeedSampler
.
Buffer
[
1
];
DataVSpeedActual
=
VSpeed
*
10
;
DataVSpeedActual
=
VSpeed
*
10
;
}
}
DataVSpeedSampler
.
Timer
=
0
;
//
DataVSpeedSampler.Timer = 0;
DataVSpeedSampler
.
Timer1
=
0
;
//
DataVSpeedSampler.Timer1 = 0;
DataVSpeedSampler
.
Backup
=
DataVSpeedActual
;
DataVSpeedSampler
.
Backup
=
DataVSpeedActual
;
DataVSpeedValid
=
1
;
DataVSpeedValid
=
1
;
}
}
...
@@ -132,18 +135,128 @@ void Data_Vehicle_Speed_Processing_Service(void)
...
@@ -132,18 +135,128 @@ void Data_Vehicle_Speed_Processing_Service(void)
{
{
DataVSpeedValid
=
0
;
DataVSpeedValid
=
0
;
DataVSpeedActual
=
0
;
DataVSpeedActual
=
0
;
DataVSpeedSampler
.
Timer
=
0
;
//
DataVSpeedSampler.Timer = 0;
DataVSpeedSampler
.
Timer1
=
0
;
//
DataVSpeedSampler.Timer1 = 0;
DataVSpeedSampler
.
Cnt
=
0
;
DataVSpeedSampler
.
Cnt
=
0
;
DataVSpeedSampler
.
Backup
=
0
;
DataVSpeedSampler
.
Backup
=
0
;
}
}
DataVSpeedTarget
=
DataVSpeedActual
;
if
(
DataVSpeedValid
)
{
DataVSpeedTarget
*=
108
;
DataVSpeedTarget
/=
100
;
if
(
DataVSpeedTarget
>
1990
)
{
DataVSpeedTarget
=
1990
;
}
}
else
{
DataVSpeedTarget
=
0
;
}
if
(
(
DataVSpeedTarget
>=
DataVSpeedHysteresis
)
||
(
DataVSpeedTarget
<
DATA_VSPEED_HYSTERESIS
)
)
{
DataVSpeedHysteresis
=
DataVSpeedTarget
;
}
else
{
if
(
DataVSpeedHysteresis
-
DataVSpeedTarget
>=
DATA_VSPEED_HYSTERESIS
)
{
DataVSpeedHysteresis
=
DataVSpeedTarget
;
}
}
DataVSpeedSampler
.
Timer
++
;
if
(
DataVSpeedSampler
.
Timer
>=
10
)
{
DataVSpeedSampler
.
Timer
=
0
;
if
(
DataVSpeedDisp
<
DataVSpeedHysteresis
)
{
DataVSPeedDamping
.
Dir
=
DATA_APPR_DIR_INC
;
}
else
if
(
DataVSpeedDisp
>
DataVSpeedHysteresis
)
{
DataVSPeedDamping
.
Dir
=
DATA_APPR_DIR_DEC
;
}
else
{
;
}
if
(
DataVSPeedDamping
.
Dir
==
DATA_APPR_DIR_INC
)
{
if
(
DataVSpeedHysteresis
>=
DataVSpeedDisp
)
{
if
(
DataVSpeedHysteresis
>
(
DataVSpeedDisp
+
400
))
{
DataVSpeedDisp
+=
370
;
}
else
if
(
DataVSpeedHysteresis
>
(
DataVSpeedDisp
+
150
))
{
DataVSpeedDisp
+=
120
;
}
else
if
(
DataVSpeedHysteresis
>
(
DataVSpeedDisp
+
50
))
{
DataVSpeedDisp
+=
30
;
}
else
if
(
DataVSpeedHysteresis
>
(
DataVSpeedDisp
+
10
))
{
DataVSpeedDisp
+=
10
;
}
else
{
DataVSpeedDisp
=
DataVSpeedHysteresis
;
}
}
}
else
if
(
DataVSPeedDamping
.
Dir
==
DATA_APPR_DIR_DEC
)
{
if
(
DataVSpeedHysteresis
<
DataVSpeedDisp
)
{
if
((
DataVSpeedHysteresis
+
400
)
<
DataVSpeedDisp
)
{
DataVSpeedDisp
-=
370
;
}
else
if
((
DataVSpeedHysteresis
+
150
)
<
DataVSpeedDisp
)
{
DataVSpeedDisp
-=
120
;
}
else
if
((
DataVSpeedHysteresis
+
50
)
<
DataVSpeedDisp
)
{
DataVSpeedDisp
-=
30
;
}
else
if
((
DataVSpeedHysteresis
+
10
)
<
DataVSpeedDisp
)
{
DataVSpeedDisp
-=
10
;
}
else
{
DataVSpeedDisp
=
DataVSpeedHysteresis
;
}
}
if
(
DataVSpeedDisp
>=
1990
)
{
DataVSpeedDisp
=
1990
;
}
}
}
#if(0)
// 第2步:车速的阻尼处理
// 第2步:车速的阻尼处理
VSpeed
=
DataVSpeedActual
;
VSpeed
=
DataVSpeedActual
;
if
(
VSpeed
>
DataVSPeedDamping
.
Speed
)
// 实际值比当前显示值大时
if
(
VSpeed
>
DataVSPeedDamping
.
Speed
)
// 实际值比当前显示值大时
{
{
Delta
=
(
uint16_t
)
VSpeed
-
DataVSPeedDamping
.
Speed
;
Delta
=
(
uint16_t
)
VSpeed
-
DataVSPeedDamping
.
Speed
;
if
(
DataVSPeedDamping
.
Dir
==
DATA_APPR_DIR_INC
)
// 显示值正在向实际值增加,则维持当前方向调节增加速度
if
(
DataVSPeedDamping
.
Dir
==
DATA_APPR_DIR_INC
)
// 显示值正在向实际值增加,则维持当前方向调节增加速度
{
{
if
(
DataVSPeedDamping
.
Delta
<
Delta
)
// 当前增量小于显示值与实际值的差值,则提升增加的速度
if
(
DataVSPeedDamping
.
Delta
<
Delta
)
// 当前增量小于显示值与实际值的差值,则提升增加的速度
...
@@ -304,6 +417,7 @@ void Data_Vehicle_Speed_Processing_Service(void)
...
@@ -304,6 +417,7 @@ void Data_Vehicle_Speed_Processing_Service(void)
{
{
DataVSpeedDisp
=
0
;
DataVSpeedDisp
=
0
;
}
}
#endif
}
}
/*车速有效位:有效=1,无效=0*/
/*车速有效位:有效=1,无效=0*/
...
...
Firmware/Source/Application/GUI_Display/GUI_Display.c
View file @
b2121838
...
@@ -112,15 +112,8 @@ void Gauge_Service(void)
...
@@ -112,15 +112,8 @@ void Gauge_Service(void)
// BU98R10Chip1DDRAM.Byte[i] = 0x77;
// BU98R10Chip1DDRAM.Byte[i] = 0x77;
//}
//}
if
(
VSpeed_Count
<
3
)
{
VSpeed_Count
++
;
}
else
{
VSpeed_Count
=
0
;
SEG_SET_VSpeed_NUM
(
1u
,
Get_DispVechileSpeed
(
)
/
10u
,
Get_Dis_KM_Unit
());
SEG_SET_VSpeed_NUM
(
1u
,
Get_DispVechileSpeed
(
)
/
10u
,
Get_Dis_KM_Unit
());
}
SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS
(
Get_Dis_KM_Unit
(),
Get_ODO_Value
()
/
10u
,
Get_Trip_Value
());
SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS
(
Get_Dis_KM_Unit
(),
Get_ODO_Value
()
/
10u
,
Get_Trip_Value
());
Gauge_Clock_Display
();
Gauge_Clock_Display
();
...
...
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