Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiancetai
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
陈家乐
jiancetai
Commits
7162323b
Commit
7162323b
authored
Oct 13, 2025
by
何锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:电量表更新
parent
579303ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
g_Var.h
app_Headers/g_Var.h
+1
-0
app_CAN.c
app_Sources/app_CAN.c
+23
-12
No files found.
app_Headers/g_Var.h
View file @
7162323b
...
...
@@ -46,6 +46,7 @@
EXTERN_VAR
volatile
_CanMsg
g_Msg1B1
;
EXTERN_VAR
volatile
_CanMsg
g_Msg755
;
EXTERN_VAR
volatile
_CanMsg
g_Msg2B1
;
EXTERN_VAR
volatile
_CanMsg
g_Msg660
;
EXTERN_VAR
volatile
_CanMsg
g_Msg3B0
;
EXTERN_VAR
volatile
_CanMsg
g_Msg402
;
//������ָʾ��
EXTERN_VAR
volatile
__RevCanMsg
g_Msg18DAF917
;
...
...
app_Sources/app_CAN.c
View file @
7162323b
...
...
@@ -158,7 +158,8 @@ void app_Can_handle(void)
g_bReturn
=
bsp_CANSendFrame
(
g_Msg1B1
.
id
,
g_Msg1B1
.
prio
,
g_Msg1B1
.
dlc
,
g_Msg1B1
.
data
);
g_bReturn
=
bsp_CANSendFrame
(
g_Msg755
.
id
,
g_Msg755
.
prio
,
g_Msg755
.
dlc
,
g_Msg755
.
data
);
g_bReturn
=
bsp_CANSendFrame
(
g_Msg2B1
.
id
,
g_Msg2B1
.
prio
,
g_Msg2B1
.
dlc
,
g_Msg2B1
.
data
);
if
((
G_Button
.
LED_STEP
!=
0
)
&&
(
G_Button
.
LED_STEP
!=
1
))
g_bReturn
=
bsp_CANSendFrame
(
g_Msg660
.
id
,
g_Msg660
.
prio
,
g_Msg660
.
dlc
,
g_Msg660
.
data
);
if
((
G_Button
.
LED_STEP
!=
0
)
&&
(
G_Button
.
LED_STEP
!=
1
)
&&
((
G_Button
.
LED_STEP
!=
2
)))
{
g_bReturn
=
bsp_CANSendFrame
(
g_Msg3B0
.
id
,
g_Msg3B0
.
prio
,
g_Msg3B0
.
dlc
,
g_Msg3B0
.
data
);
}
...
...
@@ -363,6 +364,10 @@ void app_Can_IdInit(void)
g_Msg3B0
.
id
=
0X3B0
;
g_Msg3B0
.
prio
=
0
;
g_Msg3B0
.
dlc
=
8
;
g_Msg660
.
id
=
0X660
;
g_Msg660
.
prio
=
0
;
g_Msg660
.
dlc
=
8
;
}
...
...
@@ -706,7 +711,6 @@ void app_Can_handle_PA5(void) {
g_Msg18FF5000
.
data
[
7
].
bbyte
=
0x00
;
g_Msg18FF5100
.
data
[
1
].
bbyte
=
0x00
;
g_Msg18FF5100
.
data
[
2
].
bbyte
=
0x00
;
g_Msg1B1
.
data
[
1
].
bbyte
=
0x00
;
//电量
...
...
@@ -718,6 +722,8 @@ void app_Can_handle_PA5(void) {
g_Msg3B0
.
data
[
1
].
bbyte
=
0x00
;
g_Msg3B0
.
data
[
2
].
bbyte
=
0x00
;
g_Msg3B0
.
data
[
3
].
bbyte
=
0x00
;
g_Msg660
.
data
[
0
].
bbyte
=
0x00
;
//蓄电池
}
if
(
G_Button
.
LED_STEP
==
1
)
{
...
...
@@ -747,8 +753,7 @@ void app_Can_handle_PA5(void) {
g_Msg18FF5000
.
data
[
7
].
bbyte
=
0x00
;
g_Msg18FF5100
.
data
[
1
].
bbyte
=
0x79
;
g_Msg18FF5100
.
data
[
2
].
bbyte
=
0x00
;
g_Msg18FF5100
.
data
[
1
].
bbyte
=
0x00
;
g_Msg1B1
.
data
[
0
].
bbyte
=
0x03
;
//电量10
g_Msg1B1
.
data
[
1
].
bbyte
=
0xE8
;
...
...
@@ -761,6 +766,8 @@ void app_Can_handle_PA5(void) {
g_Msg3B0
.
data
[
1
].
bbyte
=
0x00
;
g_Msg3B0
.
data
[
2
].
bbyte
=
0x00
;
g_Msg3B0
.
data
[
3
].
bbyte
=
0x00
;
g_Msg660
.
data
[
0
].
bbyte
=
0x05
;
//蓄电池灯以及警报灯
}
if
(
G_Button
.
LED_STEP
==
2
)
{
...
...
@@ -789,7 +796,6 @@ void app_Can_handle_PA5(void) {
g_Msg18FF5000
.
data
[
7
].
bbyte
=
0x80
;
g_Msg18FF5100
.
data
[
1
].
bbyte
=
0x00
;
g_Msg18FF5100
.
data
[
2
].
bbyte
=
0x00
;
g_Msg1B1
.
data
[
0
].
bbyte
=
0x0F
;
//电量40
g_Msg1B1
.
data
[
1
].
bbyte
=
0xA0
;
...
...
@@ -802,6 +808,8 @@ void app_Can_handle_PA5(void) {
g_Msg3B0
.
data
[
1
].
bbyte
=
0x00
;
g_Msg3B0
.
data
[
2
].
bbyte
=
0x02
;
g_Msg3B0
.
data
[
3
].
bbyte
=
0x58
;
g_Msg660
.
data
[
0
].
bbyte
=
0x00
;
//蓄电池
}
if
(
G_Button
.
LED_STEP
==
3
)
{
...
...
@@ -832,12 +840,11 @@ g_Msg12B.data[2].bbyte=0x05;
g_Msg18FF5000
.
data
[
7
].
bbyte
=
0x80
;
g_Msg18FF5100
.
data
[
1
].
bbyte
=
0x00
;
g_Msg18FF5100
.
data
[
2
].
bbyte
=
0x00
;
g_Msg1B1
.
data
[
0
].
bbyte
=
0x17
;
//电量60
g_Msg1B1
.
data
[
1
].
bbyte
=
0x70
;
g_Msg755
.
data
[
0
].
bbyte
=
0x
41
;
//车速3
0
g_Msg755
.
data
[
0
].
bbyte
=
0x
5C
;
//车速4
0
g_Msg2B1
.
data
[
2
].
bbyte
=
0x40
;
//充电
...
...
@@ -845,6 +852,8 @@ g_Msg12B.data[2].bbyte=0x05;
g_Msg3B0
.
data
[
1
].
bbyte
=
0x00
;
g_Msg3B0
.
data
[
2
].
bbyte
=
0x02
;
g_Msg3B0
.
data
[
3
].
bbyte
=
0x58
;
g_Msg660
.
data
[
0
].
bbyte
=
0x00
;
//蓄电池
}
if
(
G_Button
.
LED_STEP
==
4
)
{
...
...
@@ -875,12 +884,11 @@ g_Msg12B.data[2].bbyte=0x05;
g_Msg18FF5000
.
data
[
7
].
bbyte
=
0x00
;
g_Msg18FF5100
.
data
[
1
].
bbyte
=
0x00
;
g_Msg18FF5100
.
data
[
2
].
bbyte
=
0x40
;
g_Msg1B1
.
data
[
0
].
bbyte
=
0x27
;
//电量100
g_Msg1B1
.
data
[
1
].
bbyte
=
0x10
;
g_Msg755
.
data
[
0
].
bbyte
=
0x
68
;
//车速45
g_Msg755
.
data
[
0
].
bbyte
=
0x
B9
;
//车速80
g_Msg2B1
.
data
[
2
].
bbyte
=
0x00
;
//充电
...
...
@@ -888,6 +896,8 @@ g_Msg12B.data[2].bbyte=0x05;
g_Msg3B0
.
data
[
1
].
bbyte
=
0xF6
;
g_Msg3B0
.
data
[
2
].
bbyte
=
0x00
;
g_Msg3B0
.
data
[
3
].
bbyte
=
0x00
;
g_Msg660
.
data
[
0
].
bbyte
=
0x00
;
//蓄电池
}
if
(
G_Button
.
LED_STEP
==
5
)
...
...
@@ -918,13 +928,12 @@ g_Msg12B.data[2].bbyte=0x05;
g_Msg18FF5000
.
data
[
7
].
bbyte
=
0x80
;
g_Msg18FF5100
.
data
[
1
].
bbyte
=
0x79
;
g_Msg18FF5100
.
data
[
2
].
bbyte
=
0x40
;
g_Msg18FF5100
.
data
[
1
].
bbyte
=
0x82
;
g_Msg1B1
.
data
[
0
].
bbyte
=
0x03
;
//电量10
g_Msg1B1
.
data
[
1
].
bbyte
=
0xE8
;
g_Msg755
.
data
[
0
].
bbyte
=
0x
68
;
//车速45
g_Msg755
.
data
[
0
].
bbyte
=
0x
BE
;
//车速80
g_Msg2B1
.
data
[
2
].
bbyte
=
0x40
;
//充电
...
...
@@ -932,6 +941,8 @@ g_Msg12B.data[2].bbyte=0x05;
g_Msg3B0
.
data
[
1
].
bbyte
=
0xF6
;
g_Msg3B0
.
data
[
2
].
bbyte
=
0x02
;
g_Msg3B0
.
data
[
3
].
bbyte
=
0x58
;
g_Msg660
.
data
[
0
].
bbyte
=
0x05
;
//蓄电池
}
if
(
G_Button
.
LED_STEP
==
6
)
{
...
...
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