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
24f9d12e
Commit
24f9d12e
authored
Aug 07, 2024
by
陈家乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:52964 胎压从学习成功信号改为未学习的信号,2分钟后前轮恢复上一胎压值,后轮没变化,修改胎压学习逻辑
parent
9c0fc974
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
56 deletions
+75
-56
Data_TPMS.c
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
+75
-56
No files found.
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
View file @
24f9d12e
...
...
@@ -2,8 +2,10 @@
#include "Data_TPMS\Data_TPMS.h"
_TPMS_Display
TPMS
;
uint32_t
LearnTime_Count
=
0
;
uint32_t
LearnTime_Count1
=
0
;
uint32_t
Front_LearnTime_Count0
=
0
;
uint32_t
Front_LearnTime_Count1
=
0
;
uint32_t
Rear_LearnTime_Count0
=
0
;
uint32_t
Rear_LearnTime_Count1
=
0
;
uint8_t
Can_341_Flg
=
0
;
void
Data_TPMS_KL30_Init
(
void
)
{
...
...
@@ -26,8 +28,10 @@ void Data_TPMS_KL30_Init ( void )
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_LOST
=
0
;
LearnTime_Count
=
0
;
//6001;
LearnTime_Count1
=
0
;
//6001;
Front_LearnTime_Count0
=
0
;
Front_LearnTime_Count1
=
0
;
Rear_LearnTime_Count0
=
0
;
Rear_LearnTime_Count1
=
0
;
Can_341_Flg
=
0
;
}
...
...
@@ -45,10 +49,13 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void )
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_LOST
=
0
;
LearnTime_Count
=
0
;
//6001;
LearnTime_Count1
=
0
;
//6001;
Can_341_Flg
=
0
;
Front_LearnTime_Count0
=
0
;
Front_LearnTime_Count1
=
0
;
Rear_LearnTime_Count0
=
0
;
Rear_LearnTime_Count1
=
0
;
Can_341_Flg
=
0
;
}
void
Can_341_Receive
(
void
)
...
...
@@ -88,15 +95,25 @@ void Data_TPMS_Processing_Service ( void )
TPMS
.
TPMS_Rear_ID_Value
=
0
;
}
if
((
Get_CAN_CH0_ID_373_Sig_Front_id
()
!=
0
)
&&
(
Get_CAN_CH0_ID_373_Sig_Front_id
()
!=
0xFFFFFFFF
))
{
TPMS
.
TPMS_Front_ID_Value
=
1
;
//TPMS.TPMS_Front_Learn = LearningCompletion;
}
else
{
TPMS
.
TPMS_Front_ID_Value
=
0
;
}
if
((
Get_CAN_CH0_ID_373_Sig_Rear_id
()
!=
0
)
&&
(
Get_CAN_CH0_ID_373_Sig_Rear_id
()
!=
0xFFFFFFFF
))
{
TPMS
.
TPMS_Rear_ID_Value
=
1
;
}
else
{
TPMS
.
TPMS_Rear_ID_Value
=
0
;
}
}
else
{
...
...
@@ -107,20 +124,22 @@ void Data_TPMS_Processing_Service ( void )
if
(
TPMS
.
TPMS_Front_Learn
==
0x0
)
{
if
(
LearnTime_Count
<=
6000
)
{
LearnTime_Count
++
;
TPMS
.
TPMS_Front_Learn
=
Unstudied
;
//if(TPMS.TPMS_Front_Timeclean == 0)
//{
// LearnTime_Count = 0;
//}
//TPMS.TPMS_Front_Timeclean = 1;
Front_LearnTime_Count1
=
0
;
if
(
Front_LearnTime_Count0
<=
6000
)
{
Front_LearnTime_Count0
++
;
TPMS
.
TPMS_Front_Learn
=
Unstudied
;
//LearnTime_Count = 0;
}
else
{
if
(
TPMS
.
TPMS_Front_Timeclean
==
1
)
{
LearnTime_Count
=
0
;
}
TPMS
.
TPMS_Front_Timeclean
=
0
;
if
((
MenuData
.
TPMS_Front_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Front_Learn
!=
0x3
)
)
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x341_Msg_Count
)
!=
CAN_SIG_LOST
)
...
...
@@ -151,14 +170,15 @@ void Data_TPMS_Processing_Service ( void )
// TPMS.TPMS_Front_ID_Value = 0;
//}
if
(
TPMS
.
TPMS_Front_Timeclean
==
0
)
{
LearnTime_Count
=
0
;
}
TPMS
.
TPMS_Front_Timeclean
=
1
;
if
(
LearnTime_Count
<=
6000
)
//if(TPMS.TPMS_Front_Timeclean == 0)
//{
// LearnTime_Count = 0;
//}
//TPMS.TPMS_Front_Timeclean = 1;
Front_LearnTime_Count0
=
0
;
if
(
Front_LearnTime_Count1
<=
6000
)
{
LearnTime_Count
++
;
Front_LearnTime_Count1
++
;
TPMS
.
TPMS_Front_Learn
=
Learning
;
}
else
...
...
@@ -182,7 +202,8 @@ void Data_TPMS_Processing_Service ( void )
}
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x2
)
{
LearnTime_Count
=
0
;
Front_LearnTime_Count0
=
0
;
Front_LearnTime_Count1
=
0
;
//if((Get_CAN_CH0_ID_373_Sig_Front_id() != 0) && (Get_CAN_CH0_ID_373_Sig_Front_id() != 0xFFFFFFFF))
//{
// TPMS.TPMS_Front_ID_Value = 1;
...
...
@@ -196,29 +217,34 @@ void Data_TPMS_Processing_Service ( void )
}
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x3
)
{
LearnTime_Count
=
0
;
Front_LearnTime_Count0
=
0
;
Front_LearnTime_Count1
=
0
;
TPMS
.
TPMS_Front_Learn
=
LearningFailure
;
}
else
{
LearnTime_Count
=
0
;
Front_LearnTime_Count0
=
0
;
Front_LearnTime_Count1
=
0
;
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
}
if
(
TPMS
.
TPMS_Rear_Learn
==
0x0
)
{
if
(
LearnTime_Count1
<=
6000
)
//if(TPMS.TPMS_Rear_Timeclean == 0)
//{
// LearnTime_Count1 = 0;
//}
//TPMS.TPMS_Rear_Timeclean = 1;
Rear_LearnTime_Count1
=
0
;
if
(
Rear_LearnTime_Count0
<=
6000
)
{
LearnTime_Count1
++
;
// = 0;
Rear_LearnTime_Count0
++
;
// = 0;
TPMS
.
TPMS_Rear_Learn
=
Unstudied
;
}
else
{
if
(
TPMS
.
TPMS_Rear_Timeclean
==
1
)
{
LearnTime_Count1
=
0
;
}
TPMS
.
TPMS_Rear_Timeclean
=
0
;
if
((
MenuData
.
TPMS_Rear_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Rear_Learn
!=
0x3
)
)
{
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CAN_0x341_Msg_Count
)
!=
CAN_SIG_LOST
)
...
...
@@ -238,15 +264,15 @@ void Data_TPMS_Processing_Service ( void )
}
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x1
)
{
if
(
TPMS
.
TPMS_Rear_Timeclean
==
0
)
{
LearnTime_Count1
=
0
;
}
TPMS
.
TPMS_Rear_Timeclean
=
1
;
if
(
LearnTime_Count1
<=
6000
)
//
if(TPMS.TPMS_Rear_Timeclean == 0)
//
{
//
LearnTime_Count1 = 0;
//
}
//
TPMS.TPMS_Rear_Timeclean = 1;
Rear_LearnTime_Count0
=
0
;
if
(
Rear_
LearnTime_Count1
<=
6000
)
{
LearnTime_Count1
++
;
Rear_
LearnTime_Count1
++
;
TPMS
.
TPMS_Rear_Learn
=
Learning
;
}
else
...
...
@@ -271,26 +297,19 @@ void Data_TPMS_Processing_Service ( void )
}
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x2
)
{
LearnTime_Count1
=
0
;
if
((
Get_CAN_CH0_ID_373_Sig_Rear_id
()
!=
0
)
&&
(
Get_CAN_CH0_ID_373_Sig_Rear_id
()
!=
0xFFFFFFFF
))
{
TPMS
.
TPMS_Rear_ID_Value
=
1
;
//TPMS.TPMS_Rear_Learn = LearningCompletion;
}
else
{
TPMS
.
TPMS_Rear_ID_Value
=
0
;
}
Rear_LearnTime_Count0
=
0
;
Rear_LearnTime_Count1
=
0
;
}
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x3
)
{
LearnTime_Count1
=
0
;
Rear_LearnTime_Count0
=
0
;
Rear_LearnTime_Count1
=
0
;
TPMS
.
TPMS_Rear_Learn
=
LearningFailure
;
}
else
{
LearnTime_Count1
=
0
;
Rear_LearnTime_Count0
=
0
;
Rear_LearnTime_Count1
=
0
;
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Front_Learn
;
}
...
...
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