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
adf32974
Commit
adf32974
authored
Jul 05, 2024
by
陈家乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:添加220心跳及校验外发
parent
3e3a1bc4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
Can_App.c
Firmware/Source/Application/CAN_User/Can_App.c
+13
-0
Can_App.h
Firmware/Source/Application/CAN_User/Can_App.h
+2
-1
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+2
-0
No files found.
Firmware/Source/Application/CAN_User/Can_App.c
View file @
adf32974
...
...
@@ -3,10 +3,12 @@
#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
[])
{
...
...
@@ -22,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
;
}
}
...
...
Firmware/Source/Application/CAN_User/Can_App.h
View file @
adf32974
...
...
@@ -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/Component/PowerManagement/PowerManag_user.c
View file @
adf32974
...
...
@@ -245,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
;
...
...
@@ -257,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