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
87aab630
Commit
87aab630
authored
Jun 24, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:解决胎压掉线的显示问题
parent
af81c159
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
13 deletions
+107
-13
Data_TPMS.c
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
+50
-9
Data_TPMS.h
Firmware/Source/Application/Data_TPMS/Data_TPMS.h
+2
-0
SEG_DISPLAY.c
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
+55
-4
No files found.
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
View file @
87aab630
...
@@ -23,6 +23,8 @@ void Data_TPMS_KL30_Init ( void )
...
@@ -23,6 +23,8 @@ void Data_TPMS_KL30_Init ( void )
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
TPMS
.
TPMS_Front_FirstLearn_Flag
=
MenuData
.
TPMS_Front_FirstLearn_Flag
;
TPMS
.
TPMS_Front_FirstLearn_Flag
=
MenuData
.
TPMS_Front_FirstLearn_Flag
;
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_LOST
=
0
;
}
}
void
Data_TPMS_KL15_WAKE_UP_Init
(
void
)
void
Data_TPMS_KL15_WAKE_UP_Init
(
void
)
{
{
...
@@ -36,6 +38,8 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void )
...
@@ -36,6 +38,8 @@ void Data_TPMS_KL15_WAKE_UP_Init ( void )
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
TPMS
.
TPMS_Front_FirstLearn_Flag
=
MenuData
.
TPMS_Front_FirstLearn_Flag
;
TPMS
.
TPMS_Front_FirstLearn_Flag
=
MenuData
.
TPMS_Front_FirstLearn_Flag
;
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_Rear_FirstLearn_Flag
=
MenuData
.
TPMS_Rear_FirstLearn_Flag
;
TPMS
.
TPMS_LOST
=
0
;
}
}
void
Data_TPMS_Processing_Service
(
void
)
void
Data_TPMS_Processing_Service
(
void
)
...
@@ -48,11 +52,13 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -48,11 +52,13 @@ void Data_TPMS_Processing_Service ( void )
{
{
TPMS
.
TPMS_Front_Learn
=
Get_CAN_CH0_ID_341_Sig_Front_LearningStatus
();
TPMS
.
TPMS_Front_Learn
=
Get_CAN_CH0_ID_341_Sig_Front_LearningStatus
();
TPMS
.
TPMS_Rear_Learn
=
Get_CAN_CH0_ID_341_Sig_Rear_LearningStatus
();
TPMS
.
TPMS_Rear_Learn
=
Get_CAN_CH0_ID_341_Sig_Rear_LearningStatus
();
TPMS
.
TPMS_LOST
=
1
;
}
}
else
else
{
{
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
TPMS
.
TPMS_LOST
=
0
;
}
}
...
@@ -66,6 +72,8 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -66,6 +72,8 @@ void Data_TPMS_Processing_Service ( void )
else
else
{
{
if
((
MenuData
.
TPMS_Front_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Front_Learn
!=
0x3
)
)
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
)
{
{
TPMS
.
TPMS_Front_Learn
=
LearningFailure
;
TPMS
.
TPMS_Front_Learn
=
LearningFailure
;
}
}
...
@@ -73,6 +81,12 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -73,6 +81,12 @@ void Data_TPMS_Processing_Service ( void )
{
{
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
}
}
}
else
{
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
}
}
}
}
}
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x1
)
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x1
)
...
@@ -85,6 +99,8 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -85,6 +99,8 @@ void Data_TPMS_Processing_Service ( void )
else
else
{
{
if
((
MenuData
.
TPMS_Front_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Front_Learn
!=
0x3
)
)
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
)
{
{
TPMS
.
TPMS_Front_Learn
=
LearningFailure
;
TPMS
.
TPMS_Front_Learn
=
LearningFailure
;
}
}
...
@@ -93,6 +109,11 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -93,6 +109,11 @@ void Data_TPMS_Processing_Service ( void )
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
}
}
}
}
else
{
TPMS
.
TPMS_Front_Learn
=
MenuData
.
TPMS_Front_Learn
;
}
}
}
}
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x2
)
else
if
(
TPMS
.
TPMS_Front_Learn
==
0x2
)
{
{
...
@@ -128,6 +149,8 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -128,6 +149,8 @@ void Data_TPMS_Processing_Service ( void )
else
else
{
{
if
((
MenuData
.
TPMS_Rear_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Rear_Learn
!=
0x3
)
)
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
)
{
{
TPMS
.
TPMS_Rear_Learn
=
LearningFailure
;
TPMS
.
TPMS_Rear_Learn
=
LearningFailure
;
}
}
...
@@ -136,6 +159,11 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -136,6 +159,11 @@ void Data_TPMS_Processing_Service ( void )
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
}
}
}
}
else
{
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
}
}
}
}
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x1
)
else
if
(
TPMS
.
TPMS_Rear_Learn
==
0x1
)
{
{
...
@@ -147,12 +175,19 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -147,12 +175,19 @@ void Data_TPMS_Processing_Service ( void )
else
else
{
{
if
((
MenuData
.
TPMS_Rear_Learn
!=
0x2
)
&&
(
MenuData
.
TPMS_Rear_Learn
!=
0x3
)
)
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
)
{
{
TPMS
.
TPMS_Rear_Learn
=
LearningFailure
;
TPMS
.
TPMS_Rear_Learn
=
LearningFailure
;
}
}
else
else
{
{
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Front_Learn
;
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
}
}
else
{
TPMS
.
TPMS_Rear_Learn
=
MenuData
.
TPMS_Rear_Learn
;
}
}
}
}
}
}
...
@@ -240,7 +275,7 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -240,7 +275,7 @@ void Data_TPMS_Processing_Service ( void )
{
{
TPMS
.
Rear_Press_Value
=
990
;
TPMS
.
Rear_Press_Value
=
990
;
}
}
if
((
TPMS
.
Rear_Press_Value
<
170
)
||
(
TPMS
.
Rear_Press_Value
>
250
))
if
((
(
TPMS
.
Rear_Press_Value
+
5
)
<
170
)
||
((
TPMS
.
Rear_Press_Value
+
5
)
>
250
))
{
{
TPMS
.
TPMS_Warning
=
1
;
TPMS
.
TPMS_Warning
=
1
;
}
}
...
@@ -260,7 +295,7 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -260,7 +295,7 @@ void Data_TPMS_Processing_Service ( void )
{
{
TPMS
.
Front_Press_Value
=
990
;
TPMS
.
Front_Press_Value
=
990
;
}
}
if
((
TPMS
.
Front_Press_Value
<
170
)
||
(
TPMS
.
Front_Press_Value
>
230
))
if
((
(
TPMS
.
Front_Press_Value
+
5
)
<
170
)
||
((
TPMS
.
Front_Press_Value
+
5
)
>
230
))
{
{
TPMS
.
TPMS_Warning
=
1
;
TPMS
.
TPMS_Warning
=
1
;
}
}
...
@@ -273,7 +308,7 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -273,7 +308,7 @@ void Data_TPMS_Processing_Service ( void )
{
{
TPMS
.
Front_Press_Value
=
990
;
TPMS
.
Front_Press_Value
=
990
;
TPMS
.
Rear_Press_Value
=
990
;
TPMS
.
Rear_Press_Value
=
990
;
//
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
;
}
}
...
@@ -295,7 +330,7 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -295,7 +330,7 @@ void Data_TPMS_Processing_Service ( void )
{
{
TPMS
.
Rear_Press_Value
=
990
;
TPMS
.
Rear_Press_Value
=
990
;
}
}
if
((
TPMS
.
Front_Press_Value
<
170
)
||
(
TPMS
.
Front_Press_Value
>
230
)
||
(
TPMS
.
Rear_Press_Value
<
170
)
||
(
TPMS
.
Rear_Press_Value
>
250
))
if
((
(
TPMS
.
Front_Press_Value
+
5
)
<
170
)
||
((
TPMS
.
Front_Press_Value
+
5
)
>
230
)
||
((
TPMS
.
Rear_Press_Value
+
5
)
<
170
)
||
((
TPMS
.
Rear_Press_Value
+
5
)
>
250
))
{
{
TPMS
.
TPMS_Warning
=
1
;
TPMS
.
TPMS_Warning
=
1
;
}
}
...
@@ -464,3 +499,9 @@ uint8_t Get_Rear_FirstLearn_Flag (void)
...
@@ -464,3 +499,9 @@ uint8_t Get_Rear_FirstLearn_Flag (void)
return
TPMS
.
TPMS_Rear_FirstLearn_Flag
;
return
TPMS
.
TPMS_Rear_FirstLearn_Flag
;
}
}
/*获取0x341是否掉线 0-掉线 “--”闪烁 1-在线 获取学习结果进行显示*/
uint8_t
Get_TPMS_CAN_LOST
(
void
)
{
return
TPMS
.
TPMS_LOST
;
}
Firmware/Source/Application/Data_TPMS/Data_TPMS.h
View file @
87aab630
...
@@ -10,6 +10,7 @@ typedef struct __attribute__((aligned(4)))
...
@@ -10,6 +10,7 @@ typedef struct __attribute__((aligned(4)))
uint8_t
Rear_TPMS_Valid
;
uint8_t
Rear_TPMS_Valid
;
uint8_t
TPMS_Warning
;
uint8_t
TPMS_Warning
;
uint8_t
TPMS_Unit
;
uint8_t
TPMS_Unit
;
uint8_t
TPMS_LOST
;
uint8_t
TPMS_Front_Learn
;
uint8_t
TPMS_Front_Learn
;
uint8_t
TPMS_Rear_Learn
;
uint8_t
TPMS_Rear_Learn
;
uint8_t
TPMS_Front_FirstLearn_Flag
;
uint8_t
TPMS_Front_FirstLearn_Flag
;
...
@@ -36,4 +37,5 @@ uint16_t Get_Front_TPMS_TX (void);
...
@@ -36,4 +37,5 @@ uint16_t Get_Front_TPMS_TX (void);
void
Data_TPMS_KL15_WAKE_UP_Init
(
void
);
void
Data_TPMS_KL15_WAKE_UP_Init
(
void
);
uint8_t
Get_Front_FirstLearn_Flag
(
void
);
uint8_t
Get_Front_FirstLearn_Flag
(
void
);
uint8_t
Get_Rear_FirstLearn_Flag
(
void
);
uint8_t
Get_Rear_FirstLearn_Flag
(
void
);
uint8_t
Get_TPMS_CAN_LOST
(
void
);
#endif
#endif
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
View file @
87aab630
...
@@ -2171,8 +2171,59 @@ void SEG_SET_TPMS_DISPLAY(uint8_t m_Flag, uint16_t m_NUM1, uint16_t m_NUM2, uint
...
@@ -2171,8 +2171,59 @@ void SEG_SET_TPMS_DISPLAY(uint8_t m_Flag, uint16_t m_NUM1, uint16_t m_NUM2, uint
IC2_SEG138
=
IC_SEG_OFF
;
IC2_SEG138
=
IC_SEG_OFF
;
}
}
}
}
if
(
Get_TPMS_CAN_LOST
()
==
0
)
{
if
(
FLASH_SYNC_1Hz
)
{
IC2_SEG140
=
IC_SEG_ON
;
IC2_SEG133
=
IC_SEG_ON
;
IC2_SEG120
=
IC_SEG_ON
;
IC2_SEG113
=
IC_SEG_ON
;
}
else
{
IC2_SEG140
=
IC_SEG_OFF
;
IC2_SEG133
=
IC_SEG_OFF
;
IC2_SEG120
=
IC_SEG_OFF
;
IC2_SEG113
=
IC_SEG_OFF
;
}
IC2_SEG143
=
IC_SEG_OFF
;
IC2_SEG141
=
IC_SEG_OFF
;
IC2_SEG139
=
IC_SEG_OFF
;
IC2_SEG146
=
IC_SEG_OFF
;
IC2_SEG145
=
IC_SEG_OFF
;
IC2_SEG144
=
IC_SEG_OFF
;
IC2_SEG135
=
IC_SEG_OFF
;
IC2_SEG134
=
IC_SEG_OFF
;
IC2_SEG132
=
IC_SEG_OFF
;
IC2_SEG131
=
IC_SEG_OFF
;
IC2_SEG137
=
IC_SEG_OFF
;
IC2_SEG136
=
IC_SEG_OFF
;
IC2_SEG123
=
IC_SEG_OFF
;
IC2_SEG121
=
IC_SEG_OFF
;
IC2_SEG119
=
IC_SEG_OFF
;
IC2_SEG126
=
IC_SEG_OFF
;
IC2_SEG125
=
IC_SEG_OFF
;
IC2_SEG124
=
IC_SEG_OFF
;
IC2_SEG115
=
IC_SEG_OFF
;
IC2_SEG114
=
IC_SEG_OFF
;
IC2_SEG112
=
IC_SEG_OFF
;
IC2_SEG111
=
IC_SEG_OFF
;
IC2_SEG117
=
IC_SEG_OFF
;
IC2_SEG116
=
IC_SEG_OFF
;
}
else
{
SEG_SET_FRONT_TPMS_NUM
(
Get_Front_FirstLearn_Flag
(),
m_NUM1
,
m_valid1
);
SEG_SET_FRONT_TPMS_NUM
(
Get_Front_FirstLearn_Flag
(),
m_NUM1
,
m_valid1
);
SEG_SET_Rear_TPMS_NUM
(
Get_Rear_FirstLearn_Flag
(),
m_NUM2
,
m_valid2
);
SEG_SET_Rear_TPMS_NUM
(
Get_Rear_FirstLearn_Flag
(),
m_NUM2
,
m_valid2
);
}
}
}
else
else
{
{
...
...
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