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
059a9add
Commit
059a9add
authored
May 21, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:43285,胎压值计算四舍五入
parent
63829cb3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
29 deletions
+24
-29
Data_TPMS.c
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
+24
-29
No files found.
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
View file @
059a9add
...
@@ -40,13 +40,12 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -40,13 +40,12 @@ void Data_TPMS_Processing_Service ( void )
TPMS
.
Rear_TPMS_Valid
=
1
;
TPMS
.
Rear_TPMS_Valid
=
1
;
TPMS
.
Front_Press_Value
=
99
;
TPMS
.
Front_Press_Value
=
99
;
TPMS
.
Rear_Press_Value
=
Rear_TPMS
*
275
;
TPMS
.
Rear_Press_Value
=
Rear_TPMS
*
275
;
TPMS
.
Rear_Press_Value
/=
10
;
TPMS
.
Rear_Press_Value
/=
102
;
TPMS
.
Rear_Press_Value
/=
102
;
if
(
TPMS
.
Rear_Press_Value
>
99
)
if
(
TPMS
.
Rear_Press_Value
>
99
0
)
{
{
TPMS
.
Rear_Press_Value
=
99
;
TPMS
.
Rear_Press_Value
=
99
0
;
}
}
if
((
TPMS
.
Rear_Press_Value
<
17
)
||
(
TPMS
.
Rear_Press_Value
>
25
))
if
((
TPMS
.
Rear_Press_Value
<
17
0
)
||
(
TPMS
.
Rear_Press_Value
>
250
))
{
{
TPMS
.
TPMS_Warning
=
1
;
TPMS
.
TPMS_Warning
=
1
;
}
}
...
@@ -61,13 +60,12 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -61,13 +60,12 @@ void Data_TPMS_Processing_Service ( void )
TPMS
.
Rear_TPMS_Valid
=
0
;
TPMS
.
Rear_TPMS_Valid
=
0
;
TPMS
.
Rear_Press_Value
=
99
;
TPMS
.
Rear_Press_Value
=
99
;
TPMS
.
Front_Press_Value
=
Front_TPMS
*
275
;
TPMS
.
Front_Press_Value
=
Front_TPMS
*
275
;
TPMS
.
Front_Press_Value
/=
10
;
TPMS
.
Front_Press_Value
/=
102
;
TPMS
.
Front_Press_Value
/=
102
;
if
(
TPMS
.
Front_Press_Value
>
99
)
if
(
TPMS
.
Front_Press_Value
>
99
0
)
{
{
TPMS
.
Front_Press_Value
=
99
;
TPMS
.
Front_Press_Value
=
99
0
;
}
}
if
((
TPMS
.
Front_Press_Value
<
17
)
||
(
TPMS
.
Front_Press_Value
>
23
))
if
((
TPMS
.
Front_Press_Value
<
17
0
)
||
(
TPMS
.
Front_Press_Value
>
230
))
{
{
TPMS
.
TPMS_Warning
=
1
;
TPMS
.
TPMS_Warning
=
1
;
}
}
...
@@ -78,8 +76,8 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -78,8 +76,8 @@ void Data_TPMS_Processing_Service ( void )
}
}
else
else
{
{
TPMS
.
Front_Press_Value
=
99
;
TPMS
.
Front_Press_Value
=
99
0
;
TPMS
.
Rear_Press_Value
=
99
;
TPMS
.
Rear_Press_Value
=
99
0
;
TPMS
.
TPMS_Warning
=
0
;
TPMS
.
TPMS_Warning
=
0
;
TPMS
.
Front_TPMS_Valid
=
0
;
TPMS
.
Front_TPMS_Valid
=
0
;
TPMS
.
Rear_TPMS_Valid
=
0
;
TPMS
.
Rear_TPMS_Valid
=
0
;
...
@@ -89,22 +87,20 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -89,22 +87,20 @@ void Data_TPMS_Processing_Service ( void )
{
{
TPMS
.
Front_TPMS_Valid
=
1
;
TPMS
.
Front_TPMS_Valid
=
1
;
TPMS
.
Rear_TPMS_Valid
=
1
;
TPMS
.
Rear_TPMS_Valid
=
1
;
TPMS
.
Front_Press_Value
=
Front_TPMS
*
275
;
TPMS
.
Front_Press_Value
=
Front_TPMS
*
275
;
TPMS
.
Front_Press_Value
/=
10
;
TPMS
.
Front_Press_Value
/=
102
;
TPMS
.
Front_Press_Value
/=
102
;
if
(
TPMS
.
Front_Press_Value
>
99
)
if
(
TPMS
.
Front_Press_Value
>
99
0
)
{
{
TPMS
.
Front_Press_Value
=
99
;
TPMS
.
Front_Press_Value
=
99
0
;
}
}
TPMS
.
Rear_Press_Value
=
Rear_TPMS
*
275
;
TPMS
.
Rear_Press_Value
=
Rear_TPMS
*
275
;
TPMS
.
Rear_Press_Value
/=
10
;
TPMS
.
Rear_Press_Value
/=
102
;
TPMS
.
Rear_Press_Value
/=
102
;
if
(
TPMS
.
Rear_Press_Value
>
99
)
if
(
TPMS
.
Rear_Press_Value
>
99
0
)
{
{
TPMS
.
Rear_Press_Value
=
99
;
TPMS
.
Rear_Press_Value
=
99
0
;
}
}
if
((
TPMS
.
Front_Press_Value
<
17
)
||
(
TPMS
.
Front_Press_Value
>
23
)
||
(
TPMS
.
Rear_Press_Value
<
17
)
||
(
TPMS
.
Rear_Press_Value
>
25
))
if
((
TPMS
.
Front_Press_Value
<
17
0
)
||
(
TPMS
.
Front_Press_Value
>
230
)
||
(
TPMS
.
Rear_Press_Value
<
170
)
||
(
TPMS
.
Rear_Press_Value
>
250
))
{
{
TPMS
.
TPMS_Warning
=
1
;
TPMS
.
TPMS_Warning
=
1
;
}
}
...
@@ -129,10 +125,7 @@ uint16_t Data_Bar_To_Psi (uint16_t bar)
...
@@ -129,10 +125,7 @@ uint16_t Data_Bar_To_Psi (uint16_t bar)
{
{
bar
*=
145
;
bar
*=
145
;
bar
/=
10
;
bar
/=
10
;
if
((
bar
%
5
)
>=
5
)
bar
+=
5
;
{
bar
+=
5
;
}
return
bar
;
return
bar
;
}
}
uint8_t
Get_Led_TPMS_Waring
(
void
)
uint8_t
Get_Led_TPMS_Waring
(
void
)
...
@@ -153,15 +146,16 @@ uint16_t Get_Front_TPMS_Sig_Value (void)
...
@@ -153,15 +146,16 @@ uint16_t Get_Front_TPMS_Sig_Value (void)
uint16_t
value
=
0
;
uint16_t
value
=
0
;
if
(
TPMS
.
TPMS_Unit
==
1
)
if
(
TPMS
.
TPMS_Unit
==
1
)
{
{
value
=
Data_Bar_To_Psi
(
TPMS
.
Front_Press_Value
)
/
10
;
value
=
Data_Bar_To_Psi
(
TPMS
.
Front_Press_Value
)
/
10
0
;
if
(
value
>
99
)
if
(
value
>
99
)
{
{
value
=
99
;
value
=
99
;
}
}
}
}
else
else
{
{
value
=
TPMS
.
Front_Press_Value
;
TPMS
.
Front_Press_Value
+=
5
;
value
=
TPMS
.
Front_Press_Value
/
10
;
}
}
return
value
;
return
value
;
}
}
...
@@ -170,7 +164,7 @@ uint16_t Get_Rear_TPMS_Sig_Value (void)
...
@@ -170,7 +164,7 @@ uint16_t Get_Rear_TPMS_Sig_Value (void)
uint16_t
value
=
0
;
uint16_t
value
=
0
;
if
(
TPMS
.
TPMS_Unit
==
1
)
if
(
TPMS
.
TPMS_Unit
==
1
)
{
{
value
=
Data_Bar_To_Psi
(
TPMS
.
Rear_Press_Value
)
/
10
;
value
=
Data_Bar_To_Psi
(
TPMS
.
Rear_Press_Value
)
/
10
0
;
if
(
value
>
99
)
if
(
value
>
99
)
{
{
value
=
99
;
value
=
99
;
...
@@ -178,8 +172,9 @@ uint16_t Get_Rear_TPMS_Sig_Value (void)
...
@@ -178,8 +172,9 @@ uint16_t Get_Rear_TPMS_Sig_Value (void)
}
}
else
else
{
{
value
=
TPMS
.
Rear_Press_Value
;
TPMS
.
Rear_Press_Value
+=
5
;
value
=
TPMS
.
Rear_Press_Value
/
10
;
}
}
return
value
;
return
value
;
}
}
...
...
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