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
024bf516
Commit
024bf516
authored
Jul 06, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'CHENJIALE' into 'dev'
Chenjiale See merge request
!42
parents
70ab7aec
b10863a3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
54 deletions
+114
-54
Can_App.c
Firmware/Source/Application/CAN_User/Can_App.c
+36
-6
Can_App.h
Firmware/Source/Application/CAN_User/Can_App.h
+2
-1
Data_TPMS.c
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
+8
-1
SEG_DISPLAY.c
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
+62
-46
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+6
-0
No files found.
Firmware/Source/Application/CAN_User/Can_App.c
View file @
024bf516
...
...
@@ -2,7 +2,14 @@
#include "Components.h"
#include "Application.h"
uint16_t
CAN_TX_Count
=
0
;
uint16_t
AliveCountTimer
=
0
;
extern
uint8_t
Tpms_TX_Flag
;
void
CAN_TX_Count_Init
(
void
)
{
CAN_TX_Count
=
0
;
AliveCountTimer
=
0
;
}
void
Can_Set_Buff_220
(
canlib_uint8_t
CopyData
[])
{
CANMsg220Union
*
p220
;
...
...
@@ -17,6 +24,17 @@ void Can_Set_Buff_220(canlib_uint8_t CopyData[])
}
p220
->
Sig
.
TCS_TX
=
Get_Dis_Tcs_Val
();
p220
->
Sig
.
AliveCounter
=
AliveCountTimer
;
p220
->
Sig
.
CheckSum
=
(
Get_Dis_Tcs_Val
()
==
1
)
?
8
:
0
;
}
if
(
AliveCountTimer
<
7
)
{
AliveCountTimer
++
;
}
else
{
AliveCountTimer
=
0
;
}
}
...
...
@@ -25,7 +43,7 @@ void Can_Set_Buff_6EE(canlib_uint8_t CopyData[])
CANMsg6EEUnion
*
p6EE
;
uint8_t
i
=
0
;
uint16_t
Vspeed_tx
=
0
;
uint32_t
ODO_tx
=
Data_ODO_Read
()
/
10
;
uint32_t
ODO_tx
=
Data_ODO_Read
();
Vspeed_tx
=
Get_DispVechileSpeed_TX
()
/
10
;
p6EE
=
(
CANMsg6EEUnion
*
)
CopyData
;
...
...
@@ -106,8 +124,8 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
}
else
{
p450
->
Sig
.
Front_Pressure_TX_H
=
(
Get_Front_TPMS_TX
(
)
>>
8
)
&
0xFF
;
p450
->
Sig
.
Front_Pressure_TX_L
=
Get_Front_TPMS_TX
(
)
&
0xFF
;
p450
->
Sig
.
Front_Pressure_TX_H
=
(
(
Get_Front_TPMS_TX
()
+
146
)
>>
8
)
&
0xFF
;
p450
->
Sig
.
Front_Pressure_TX_L
=
(
Get_Front_TPMS_TX
()
+
146
)
&
0xFF
;
}
if
(
MenuData
.
TPMS_Rear_Learn
==
0
)
{
...
...
@@ -116,13 +134,14 @@ void Can_Set_Buff_450(canlib_uint8_t CopyData[])
}
else
{
p450
->
Sig
.
Rear_Pressure_TX_H
=
(
Get_Rear_TPMS_TX
(
)
>>
8
)
&
0xFF
;
p450
->
Sig
.
Rear_Pressure_TX_L
=
Get_Rear_TPMS_TX
(
)
&
0xFF
;
p450
->
Sig
.
Rear_Pressure_TX_H
=
(
(
Get_Rear_TPMS_TX
()
+
146
)
>>
8
)
&
0xFF
;
p450
->
Sig
.
Rear_Pressure_TX_L
=
(
Get_Rear_TPMS_TX
()
+
146
)
&
0xFF
;
}
}
}
void
Can_Set_Buff_580
(
canlib_uint8_t
CopyData
[])
{
CANMsg580Union
*
p580
;
...
...
@@ -138,6 +157,11 @@ void Can_Set_Buff_580(canlib_uint8_t CopyData[])
if
(
Get_Tpms_TX_Flag
()
==
1
)
{
if
(
++
CAN_TX_Count
>=
3
)
{
Tpms_TX_Flag
=
0
;
CAN_TX_Count
=
0
;
}
p580
->
Sig
.
TPMS_LEARN_CND_BYTE0
=
0x31
;
p580
->
Sig
.
TPMS_LEARN_CND_BYTE1
=
0x01
;
p580
->
Sig
.
TPMS_LEARN_CND_BYTE2
=
0x59
;
...
...
@@ -146,6 +170,11 @@ void Can_Set_Buff_580(canlib_uint8_t CopyData[])
}
else
if
(
Get_Tpms_TX_Flag
()
==
2
)
{
if
(
++
CAN_TX_Count
>=
3
)
{
Tpms_TX_Flag
=
0
;
CAN_TX_Count
=
0
;
}
p580
->
Sig
.
TPMS_LEARN_CND_BYTE0
=
0x31
;
p580
->
Sig
.
TPMS_LEARN_CND_BYTE1
=
0x01
;
p580
->
Sig
.
TPMS_LEARN_CND_BYTE2
=
0x59
;
...
...
@@ -154,6 +183,7 @@ void Can_Set_Buff_580(canlib_uint8_t CopyData[])
}
else
{
CAN_TX_Count
=
0
;
p580
->
Sig
.
TPMS_LEARN_CND_BYTE0
=
0x0
;
p580
->
Sig
.
TPMS_LEARN_CND_BYTE1
=
0x0
;
p580
->
Sig
.
TPMS_LEARN_CND_BYTE2
=
0x0
;
...
...
Firmware/Source/Application/CAN_User/Can_App.h
View file @
024bf516
...
...
@@ -19,8 +19,9 @@ typedef union
uint32_t
Res3
:
16
;
uint32_t
Res4
:
16
;
uint32_t
Res5
:
8
;
uint32_t
AliveCounter
:
3
;
uint32_t
CheckSum
:
5
;
uint32_t
AliveCounter
:
3
;
}
Sig
;
}
CANMsg220Union
;
...
...
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
View file @
024bf516
...
...
@@ -260,7 +260,14 @@ void Data_TPMS_Processing_Service ( void )
{
MenuData
.
TPMS_Rear_Learn
=
TPMS
.
TPMS_Rear_Learn
;
}
if
((
TPMS
.
TPMS_Front_Learn
==
0x2
)
||
(
TPMS
.
TPMS_Front_Learn
==
0x3
)
||
(
TPMS
.
TPMS_Rear_Learn
==
0x2
)
||
(
TPMS
.
TPMS_Rear_Learn
==
0x3
))
if
(((
TPMS
.
TPMS_Front_Learn
==
0x2
)
||
(
TPMS
.
TPMS_Front_Learn
==
0x3
))
&&
(
TPMS
.
TPMS_Front_Learn
!=
MenuData
.
TPMS_Front_Learn
))
{
TPMS_L
[
0
]
=
MenuData
.
TPMS_Front_Learn
;
TPMS_L
[
1
]
=
MenuData
.
TPMS_Rear_Learn
;
Data_User_EEPROM_Write
(
EM_MenuData_TPMS_LEARN
,
(
uint32_t
*
)
TPMS_L
,
1u
);
}
if
(
((
TPMS
.
TPMS_Rear_Learn
==
0x2
)
||
(
TPMS
.
TPMS_Rear_Learn
==
0x3
))
&&
(
TPMS
.
TPMS_Rear_Learn
!=
MenuData
.
TPMS_Rear_Learn
))
{
TPMS_L
[
0
]
=
MenuData
.
TPMS_Front_Learn
;
TPMS_L
[
1
]
=
MenuData
.
TPMS_Rear_Learn
;
...
...
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
View file @
024bf516
...
...
@@ -2130,14 +2130,14 @@ void SEG_SET_TPMS_DISPLAY(uint8_t m_Flag, uint16_t m_NUM1, uint16_t m_NUM2, uint
IC2_SEG109
=
IC_SEG_OFF
;
IC2_SEG110
=
IC_SEG_ON
;
if
(
Get_TPMS_CAN_LOST
()
==
0
)
if
(
(
Get_TPMS_CAN_LOST
()
==
0
)
)
{
IC2_SEG138
=
IC_SEG_ON
;
IC2_SEG118
=
IC_SEG_ON
;
}
else
{
if
((
Get_Current_PageType
()
==
Page_Front_Tpms
)
||
(
Get_Front_FirstLearn_Flag
()
==
1
)
||
(
Get_Front_FirstLearn_Flag
()
==
3
)
)
if
((
Get_Current_PageType
()
==
Page_Front_Tpms
)
||
(
Get_Front_FirstLearn_Flag
()
==
1
)
)
{
if
(
FLASH_SYNC_1Hz
)
{
...
...
@@ -2153,7 +2153,7 @@ void SEG_SET_TPMS_DISPLAY(uint8_t m_Flag, uint16_t m_NUM1, uint16_t m_NUM2, uint
IC2_SEG138
=
IC_SEG_ON
;
}
if
((
Get_Current_PageType
()
==
Page_Rear_Tpms
)
||
(
Get_Rear_FirstLearn_Flag
()
==
1
)
||
(
Get_Rear_FirstLearn_Flag
()
==
3
)
)
if
((
Get_Current_PageType
()
==
Page_Rear_Tpms
)
||
(
Get_Rear_FirstLearn_Flag
()
==
1
))
{
if
(
FLASH_SYNC_1Hz
)
{
...
...
@@ -2180,7 +2180,7 @@ void SEG_SET_TPMS_DISPLAY(uint8_t m_Flag, uint16_t m_NUM1, uint16_t m_NUM2, uint
IC2_SEG138
=
IC_SEG_OFF
;
}
}
if
(
Get_TPMS_CAN_LOST
()
==
0
)
if
(
Get_TPMS_CAN_LOST
()
==
0
)
{
if
(
Get_Current_PageType
()
==
Page_Front_Tpms
)
{
...
...
@@ -2706,30 +2706,14 @@ void SEG_SET_FRONT_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM1, uint8_t m_valid1
}
else
if
(
learnflag
==
3
)
{
if
(
FLASH_SYNC_1Hz
)
{
//if (FLASH_SYNC_1Hz)
//{
IC2_SEG138
=
IC_SEG_ON
;
IC2_SEG140
=
IC_SEG_ON
;
IC2_SEG133
=
IC_SEG_ON
;
IC2_SEG143
=
IC_SEG_ON
;
IC2_SEG141
=
IC_SEG_ON
;
IC2_SEG139
=
IC_SEG_ON
;
IC2_SEG146
=
IC_SEG_ON
;
IC2_SEG145
=
IC_SEG_OFF
;
IC2_SEG144
=
IC_SEG_ON
;
IC2_SEG135
=
IC_SEG_ON
;
IC2_SEG134
=
IC_SEG_ON
;
IC2_SEG132
=
IC_SEG_ON
;
IC2_SEG131
=
IC_SEG_ON
;
IC2_SEG137
=
IC_SEG_OFF
;
IC2_SEG136
=
IC_SEG_ON
;
}
else
{
IC2_SEG140
=
IC_SEG_OFF
;
IC2_SEG133
=
IC_SEG_OFF
;
IC2_SEG143
=
IC_SEG_OFF
;
IC2_SEG141
=
IC_SEG_OFF
;
IC2_SEG139
=
IC_SEG_OFF
;
...
...
@@ -2743,7 +2727,29 @@ void SEG_SET_FRONT_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM1, uint8_t m_valid1
IC2_SEG131
=
IC_SEG_OFF
;
IC2_SEG137
=
IC_SEG_OFF
;
IC2_SEG136
=
IC_SEG_OFF
;
}
//}
//else
//{
// IC2_SEG138 = IC_SEG_OFF;
//
// IC2_SEG140 = IC_SEG_OFF;
// IC2_SEG133 = 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;
//}
}
else
{
...
...
@@ -3156,29 +3162,17 @@ void SEG_SET_Rear_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM2, uint8_t m_valid2)
}
else
if
(
learnflag
==
3
)
{
if
(
FLASH_SYNC_1Hz
)
{
//IC2_SEG118 = IC_SEG_ON;
//IC2_SEG120 = IC_SEG_ON;
//IC2_SEG113 = IC_SEG_ON;
//if (FLASH_SYNC_1Hz)
//{
IC2_SEG120
=
IC_SEG_ON
;
IC2_SEG113
=
IC_SEG_ON
;
IC2_SEG123
=
IC_SEG_ON
;
IC2_SEG121
=
IC_SEG_ON
;
IC2_SEG119
=
IC_SEG_ON
;
IC2_SEG126
=
IC_SEG_ON
;
IC2_SEG125
=
IC_SEG_OFF
;
IC2_SEG124
=
IC_SEG_ON
;
IC2_SEG118
=
IC_SEG_ON
;
IC2_SEG115
=
IC_SEG_ON
;
IC2_SEG114
=
IC_SEG_ON
;
IC2_SEG112
=
IC_SEG_ON
;
IC2_SEG111
=
IC_SEG_ON
;
IC2_SEG117
=
IC_SEG_OFF
;
IC2_SEG116
=
IC_SEG_ON
;
}
else
{
IC2_SEG120
=
IC_SEG_OFF
;
IC2_SEG113
=
IC_SEG_OFF
;
IC2_SEG123
=
IC_SEG_OFF
;
IC2_SEG121
=
IC_SEG_OFF
;
...
...
@@ -3193,7 +3187,29 @@ void SEG_SET_Rear_TPMS_NUM(uint8_t learnflag, uint16_t m_NUM2, uint8_t m_valid2)
IC2_SEG111
=
IC_SEG_OFF
;
IC2_SEG117
=
IC_SEG_OFF
;
IC2_SEG116
=
IC_SEG_OFF
;
}
//}
//else
//{
// IC2_SEG120 = IC_SEG_OFF;
// IC2_SEG113 = IC_SEG_OFF;
//
// IC2_SEG118 = 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
{
...
...
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
024bf516
...
...
@@ -93,6 +93,8 @@ static void Power_KL30_Init(void)
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
WAKEUP_KL15_In
,
Trigger_Rising
);
FaultCode_Init
();
CAN_TX_Count_Init
();
}
extern
uint32_t
PowerIgnOffTimeLine
;
static
void
Power_Wakeup_Init
(
void
)
...
...
@@ -138,6 +140,8 @@ static void Power_Wakeup_Init(void)
Data_TPMS_KL15_WAKE_UP_Init
();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable
(
WAKEUP_KL15_In
,
Trigger_Rising
);
FaultCode_Init
();
CAN_TX_Count_Init
();
}
static
void
Power_LVP_Init
(
void
)
...
...
@@ -241,6 +245,7 @@ static Power_Status_em Power_Stay_OFF(void)
return
u8PowerSts
;
}
extern
uint16_t
AliveCountTimer
;
static
Power_Status_em
Power_Stay_Protect
(
void
)
{
Power_Status_em
u8PowerSts
;
...
...
@@ -253,6 +258,7 @@ static Power_Status_em Power_Stay_Protect(void)
BU98R10_Shutdown
(
);
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
0
);
CAN_TX_SetEnable
(
&
CAN_CH0_CanMsgTxOp
,
CAN_N_TX_Disable
);
AliveCountTimer
=
0
;
}
u8PowerSts
=
EM_IGN_OFF_Init
;
/* 电溝模弝正常 */
...
...
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