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
d27dde4f
Commit
d27dde4f
authored
Jul 16, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:50220 ,将can外发放入中断中执行,解决【天鹰TY200】【外发】总线负载量83%,外发周期不稳定
parent
9d6df02e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
15 deletions
+18
-15
CAN_CH0_CAN_Communication_Matrix.c
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
+3
-3
Can_User.c
Firmware/Source/Application/CAN_User/Can_User.c
+12
-10
can.c
...ource/Device/Cmsemicon/BAT32A239/Library/Driver/src/can.c
+1
-1
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+2
-1
No files found.
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
View file @
d27dde4f
...
...
@@ -9,9 +9,9 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
const
st_CAN_SendAttribute
CAN_CH0_CANSendAttr
[
CAN_CH0_ID_SEND_TOTAL
]
=
{
{
0x220ul
,
50ul
*
1000ul
,
7ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_220
,
(
void
*
)
0
},
{
0x6EEul
,
100ul
*
1000ul
,
7ul
*
1000ul
,
0u
,
MSG_STD
,
1
u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_6EE
,
(
void
*
)
0
},
{
0x6EFul
,
100ul
*
1000ul
,
7ul
*
1000ul
,
0u
,
MSG_STD
,
1
u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_6EF
,
(
void
*
)
0
},
{
0x450ul
,
100ul
*
1000ul
,
7ul
*
1000ul
,
0u
,
MSG_STD
,
1
u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_450
,
(
void
*
)
0
},
{
0x6EEul
,
100ul
*
1000ul
,
8ul
*
1000ul
,
0u
,
MSG_STD
,
2
u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_6EE
,
(
void
*
)
0
},
{
0x6EFul
,
100ul
*
1000ul
,
9ul
*
1000ul
,
0u
,
MSG_STD
,
3
u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_6EF
,
(
void
*
)
0
},
{
0x450ul
,
100ul
*
1000ul
,
10ul
*
1000ul
,
0u
,
MSG_STD
,
4
u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_450
,
(
void
*
)
0
},
#if (IC_Current == TY200_080000b_ty)
{
0x580ul
,
8ul
*
1000ul
,
0ul
*
1000ul
,
0u
,
MSG_STD
,
1u
,
8u
,
CAN_MSG_TX_CYCLE
,
Can_Set_Buff_580
,
(
void
*
)
0
},
#endif
...
...
Firmware/Source/Application/CAN_User/Can_User.c
View file @
d27dde4f
...
...
@@ -310,14 +310,15 @@ uint8_t Get_Busoff_Status(void)
uint8_t
COM_APP_Process
(
st_CAN_Msg
*
Msg
)
{
Can_Write
((
st_CAN_Msg
*
)
Msg
);
return
0
;
}
//
Can_Write((st_CAN_Msg *)Msg);
//
return 0;
//
}
void
Can_Write
(
st_CAN_Msg
*
Msg
)
{
//
void Can_Write(st_CAN_Msg *Msg)
//
{
uint32_t
i
=
0
;
CanTxRxMsg
CAN_SendMsg
;
uint8_t
CAN_result
=
0
;
CAN_SendMsg
.
Id
=
Msg
->
MsgID
;
/* ID */
CAN_SendMsg
.
DLC
=
Msg
->
MsgDLC
;
/* Len */
...
...
@@ -333,23 +334,24 @@ void Can_Write(st_CAN_Msg *Msg)
switch
(
CAN_SendMsg
.
Id
)
{
case
0x6EE
:
CAN_Transmit
(
CAN0MSG08
,
&
CAN_SendMsg
);
CAN_
result
=
CAN_
Transmit
(
CAN0MSG08
,
&
CAN_SendMsg
);
break
;
case
0x6EF
:
CAN_Transmit
(
CAN0MSG12
,
&
CAN_SendMsg
);
CAN_
result
=
CAN_
Transmit
(
CAN0MSG12
,
&
CAN_SendMsg
);
break
;
case
0x450
:
CAN_Transmit
(
CAN0MSG13
,
&
CAN_SendMsg
);
CAN_
result
=
CAN_
Transmit
(
CAN0MSG13
,
&
CAN_SendMsg
);
break
;
case
0x220
:
CAN_Transmit
(
CAN0MSG10
,
&
CAN_SendMsg
);
CAN_
result
=
CAN_
Transmit
(
CAN0MSG10
,
&
CAN_SendMsg
);
break
;
#if (IC_Current == TY200_080000b_ty)
case
0x580
:
CAN_Transmit
(
CAN0MSG14
,
&
CAN_SendMsg
);
CAN_
result
=
CAN_
Transmit
(
CAN0MSG14
,
&
CAN_SendMsg
);
break
;
#endif
default:
break
;
}
return
(
!
CAN_result
);
}
Firmware/Source/Device/Cmsemicon/BAT32A239/Library/Driver/src/can.c
View file @
d27dde4f
...
...
@@ -725,7 +725,7 @@ uint8_t CAN_Transmit(CANMSG_Type *CANxMSGy, CanTxRxMsg* TxMessage)
CANxMSGy
->
CMCTRL
=
CAN_MCTRL_CLR_RDY
;
/* Wait the operate complete */
while
(((
CANxMSGy
->
CMCTRL
&
CAN_MCTRL_RDY_MASK
)
!=
0x00
)
&&
(
timeout
!=
0
))
//
while (((CANxMSGy->CMCTRL & CAN_MCTRL_RDY_MASK) != 0x00) && (timeout != 0))
{
timeout
--
;
}
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
d27dde4f
...
...
@@ -18,7 +18,7 @@ void Sys_Pseudo_Real_Time_Tasks(void)
void
Sys_2ms_Tasks
(
void
)
{
Common_Input_Para
();
Can_Write_Fun
(
&
CAN_CH0_CanMsgTxOp
,
2000u
);
//
Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);
Sys_Status_Update_Service
();
Analog_Signal_Conv_Service
();
CanMSg_XMS_Analysis
(
&
CAN_CH0_CanMsgOp
,
2u
);
...
...
@@ -121,6 +121,7 @@ void Sys_100ms_Tasks(void)
void
Sys_Exact_50us_Tasks
(
void
)
{
static
uint32_t
task_1ms
=
0u
;
Can_Write_Fun
(
&
CAN_CH0_CanMsgTxOp
,
50u
);
DoCAN_Timer_Update
(
50u
);
GenDelay_Tick
();
task_1ms
++
;
...
...
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