Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
haoJin750TFT
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
时昊
haoJin750TFT
Commits
c350e0ac
Commit
c350e0ac
authored
Jul 29, 2024
by
郑萍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:车速行车电脑与显示对接完成,以及can中断调通
parent
f38d4795
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
15 deletions
+38
-15
Can_User.c
Firmware/Source/Application/Can_User.c
+2
-2
Data_VSpeed.c
Firmware/Source/Application/Data_VSpeed.c
+1
-2
AMT630H_Datas.c
Firmware/Source/Component/AMT630H/AMT630H_Datas.c
+19
-8
rte_can.c
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/CAN/rte_can.c
+16
-3
No files found.
Firmware/Source/Application/Can_User.c
View file @
c350e0ac
...
...
@@ -15,8 +15,8 @@ void Can_Init(void)
can_config_st_t
Can_Config
;
Can_Config
.
ch
=
CAN_CH_0
;
Can_Config
.
freq
=
CAN_500Kbps
;
Can_Config
.
MASK
[
0
]
=
0x
001
fffffU
;
Can_Config
.
MASK
[
1
]
=
0x
000
fffffU
;
Can_Config
.
MASK
[
0
]
=
0x
1ff
fffffU
;
Can_Config
.
MASK
[
1
]
=
0x
1ff
fffffU
;
Can_Config
.
MASK
[
2
]
=
0x1fffffffU
;
Can_Config
.
MASK
[
3
]
=
0x1fffffffU
;
Can_Config
.
rx_callback
=
Can_Rx_Cak
;
...
...
Firmware/Source/Application/Data_VSpeed.c
View file @
c350e0ac
...
...
@@ -82,8 +82,7 @@ void Data_Vehicle_Speed_Processing_Service(void)
if
((
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CH0_101_Msg_Count
)
==
CAN_SIG_LOST
)
||
(
Vehicle_Speed
>
0XFF
))
{
/* 先判断掉线 */
//if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x101_Msg_Count) == CAN_SIG_LOST)
if
(
1
)
if
(
CAN_MSG_Status
(
&
CAN_CH0_CanMsgOp
,
CAN_CH0_ID_CH0_101_Msg_Count
)
==
CAN_SIG_LOST
)
{
DataVSpeedValid
=
0
;
DataVSpeedActual
=
0
;
...
...
Firmware/Source/Component/AMT630H/AMT630H_Datas.c
View file @
c350e0ac
...
...
@@ -2474,7 +2474,7 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
VSpeedNumber
=
VSpeed
;
DisplayNumPara
.
NumList
=
NumbeList_VSpeed_DAY
;
if
(
100
<=
VSpeedNumber
<=
199
)
if
(
100
<=
VSpeedNumber
)
{
DisplayNumPara
.
x
=
574
;
DisplayNumPara
.
NumInterval
=
GROUP_PIC_DIR_LEFT
|
118
;
...
...
@@ -2484,7 +2484,7 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
DisplayNum
(
GRAPHICS_PAGE_0
,
&
DisplayNumPara
,
VSpeedNumber
);
}
else
if
(
10
<=
VSpeedNumber
<
100
)
else
if
(
(
10
<=
VSpeedNumber
)
)
{
DisplayNumPara
.
x
=
515
;
DisplayNumPara
.
NumInterval
=
GROUP_PIC_DIR_LEFT
|
118
;
...
...
@@ -2494,7 +2494,7 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
DisplayNum
(
GRAPHICS_PAGE_0
,
&
DisplayNumPara
,
VSpeedNumber
);
}
else
if
(
0
<=
VSpeedNumber
<
10
)
else
if
(
0
<=
VSpeedNumber
)
{
if
(
VSpeedNumber
==
1
)
{
...
...
@@ -2510,6 +2510,10 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
DisplayNumPara
.
MinDigits
=
1
;
DisplayNum
(
GRAPHICS_PAGE_0
,
&
DisplayNumPara
,
VSpeedNumber
);
}
else
{
;
}
}
else
if
((
Pic_mode
==
PIC_NIGHTTIME_Main_CH
)
||
(
Pic_mode
==
PIC_NIGHTTIME_Main_EN
))
{
...
...
@@ -2522,7 +2526,7 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
VSpeedNumber
=
VSpeed
;
DisplayNumPara
.
NumList
=
NumbeList_VSpeed_NIGHT
;
if
(
100
<=
VSpeedNumber
<=
199
)
if
(
100
<=
VSpeedNumber
)
{
DisplayNumPara
.
x
=
574
;
DisplayNumPara
.
NumInterval
=
GROUP_PIC_DIR_LEFT
|
118
;
...
...
@@ -2532,7 +2536,7 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
DisplayNum
(
GRAPHICS_PAGE_0
,
&
DisplayNumPara
,
VSpeedNumber
);
}
else
if
(
10
<=
VSpeedNumber
<
100
)
else
if
(
10
<=
VSpeedNumber
)
{
DisplayNumPara
.
x
=
515
;
DisplayNumPara
.
NumInterval
=
GROUP_PIC_DIR_LEFT
|
118
;
...
...
@@ -2542,7 +2546,7 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
DisplayNum
(
GRAPHICS_PAGE_0
,
&
DisplayNumPara
,
VSpeedNumber
);
}
else
if
(
0
<=
VSpeedNumber
<
10
)
else
if
(
0
<=
VSpeedNumber
)
{
if
(
VSpeedNumber
==
1
)
{
...
...
@@ -2654,7 +2658,7 @@ static void AMT630H_GUI_ESpeed(uint16_t ESpeed)
/******************************************************************************************/
/**
* @brief
菜单背景
* @brief
主界面显示
*
*/
void
AMT630H_GUI_BACKGRAND
()
...
...
@@ -2685,7 +2689,14 @@ void AMT630H_GUI_BACKGRAND()
AMT630H_GUI_Fuel
(
2
);
AMT630H_GUI_Voltage
(
123
);
AMT630H_GUI_ODO
(
123456
);
AMT630H_GUI_VSpeed
(
123
);
if
(
Get_VechileSpeedValid
()
==
1
)
{
AMT630H_GUI_VSpeed
(
Get_DispVechileSpeed
()
/
10
);
}
else
{
AMT630H_GUI_VSpeed
(
0
);
}
AMT630H_GUI_ESpeed
(
1234
);
}
...
...
Firmware/Source/Device/Cmsemicon/BAT32A279/RTE/CAN/rte_can.c
View file @
c350e0ac
...
...
@@ -6,8 +6,21 @@
CANMSG_Type
*
CANMSG
;
CanTxRxMsg
CAN_RecvMsg
;
CANBuffList_t
CanBufList
=
{
0
};
can_rx_callback
can_rx_handler
=
NULL
;
uint8_t
Read_RingBuff
(
CanTxRxMsg
*
data
)
{
if
(
CanBufList
.
length
==
0
)
{
return
0
;
}
*
data
=
CanBufList
.
data
[
CanBufList
.
Head
];
CanBufList
.
Head
=
(
CanBufList
.
Head
+
1
)
%
LIST_BUF_MAX_NUM
;
CanBufList
.
length
--
;
return
1
;
}
/**
* @brief CAN就收完成回调
*
...
...
@@ -20,9 +33,9 @@ static void can_recv_handler(void *msg)
if
(
CAN_GetFlagStatus
(
CAN0
,
CAN_FLAG_REC
)
!=
RESET
)
{
CAN_ClearFlag
(
CAN0
,
CAN_FLAG_REC
);
// CANMSG = CAN_Get_CANxMSGy(CAN0
);
// CAN_Receive_IT(CAN0,
&CAN_RecvMsg);
CAN_Receive_IT
(
CAN0
,
&
CanBufList
);
Read_RingBuff
(
&
CAN_RecvMsg
);
if
(
can_rx_handler
!=
NULL
)
{
can_rx_handler
(
&
CAN_RecvMsg
);
...
...
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