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
80431918
Commit
80431918
authored
Apr 28, 2025
by
何锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:M27老化台带转速
parent
915baae6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
145 additions
and
66 deletions
+145
-66
main.c
Sources/main.c
+2
-2
g_Var.h
app_Headers/g_Var.h
+2
-0
app_CAN.c
app_Sources/app_CAN.c
+58
-6
bsp_RTC.c
bsp_Sources/bsp_RTC.c
+5
-0
bsp_System.c
bsp_Sources/bsp_System.c
+62
-52
gui_Display.c
gui_Sources/gui_Display.c
+16
-6
No files found.
Sources/main.c
View file @
80431918
...
@@ -34,7 +34,7 @@ void main(void) {
...
@@ -34,7 +34,7 @@ void main(void) {
CS_OUT_N
=
CS_FR
=
120
;
CS_OUT_N
=
CS_FR
=
120
;
ZS_OUT_N
=
ZS_FR
=
7812
;
//8325
//8325
//13.36,for 800 frequency
//13.36,for 800 frequency
ZS_FRset
[
0
]
=
0
;
ZS_FRset
[
0
]
=
0
;
...
@@ -66,7 +66,7 @@ void main(void) {
...
@@ -66,7 +66,7 @@ void main(void) {
gui_LCD_Display
();
gui_LCD_Display
();
//
//
app_Can_handle
();
app_Can_handle
();
GJ_CS10_JS_ECUOUT_N
();
__RESET_WATCHDOG
();
__RESET_WATCHDOG
();
}
}
...
...
app_Headers/g_Var.h
View file @
80431918
...
@@ -35,6 +35,8 @@
...
@@ -35,6 +35,8 @@
EXTERN_VAR
volatile
_CanMsg
g_Msg0C01FF55
;
EXTERN_VAR
volatile
_CanMsg
g_Msg0C01FF55
;
EXTERN_VAR
volatile
_CanMsg
g_Msg0C01FFAB
;
EXTERN_VAR
volatile
_CanMsg
g_Msg0C01FFAB
;
EXTERN_VAR
volatile
_CanMsg
g_Msg0C01FFA5
;
EXTERN_VAR
volatile
_CanMsg
g_Msg0C01FFA5
;
EXTERN_VAR
volatile
_CanMsg
g_Msg0A31FFE8
;
EXTERN_VAR
volatile
_CanMsg
g_Msg0A30FFE8
;
EXTERN_VAR
volatile
_CanMsg
g_Msg084
;
EXTERN_VAR
volatile
_CanMsg
g_Msg084
;
EXTERN_VAR
volatile
_CanMsg
g_Msg18DA17F9
;
EXTERN_VAR
volatile
_CanMsg
g_Msg18DA17F9
;
...
...
app_Sources/app_CAN.c
View file @
80431918
...
@@ -174,8 +174,8 @@ void app_Can_handle(void)
...
@@ -174,8 +174,8 @@ void app_Can_handle(void)
}
}
if
(
api_TimerOver6
((
_Clock
*
)
&
g_Clock
))
if
(
api_TimerOver6
((
_Clock
*
)
&
g_Clock
))
{
{
api_SetTimer6
(
10
,(
_Clock
*
)
&
g_Clock
);
//10
00ms
api_SetTimer6
(
50
,(
_Clock
*
)
&
g_Clock
);
//1
00ms
g_bReturn
=
bsp_CANSendExtFrame
(
g_Msg0A31FFE8
.
id
,
g_Msg0A31FFE8
.
prio
,
g_Msg0A31FFE8
.
dlc
,
g_Msg0A31FFE8
.
data
);
// g_bReturn = bsp_CANSendExtFrame(g_Msg18FD0700.id,g_Msg18FD0700.prio,g_Msg18FD0700.dlc,g_Msg18FD0700.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg18FD0700.id,g_Msg18FD0700.prio,g_Msg18FD0700.dlc,g_Msg18FD0700.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg18FEC600.id,g_Msg18FEC600.prio,g_Msg18FEC600.dlc,g_Msg18FEC600.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg18FEC600.id,g_Msg18FEC600.prio,g_Msg18FEC600.dlc,g_Msg18FEC600.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg18850000.id,g_Msg18850000.prio,g_Msg18850000.dlc,g_Msg18850000.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg18850000.id,g_Msg18850000.prio,g_Msg18850000.dlc,g_Msg18850000.data); //1000
...
@@ -183,8 +183,8 @@ void app_Can_handle(void)
...
@@ -183,8 +183,8 @@ void app_Can_handle(void)
if
(
api_TimerOver5
((
_Clock
*
)
&
g_Clock
))
//
if
(
api_TimerOver5
((
_Clock
*
)
&
g_Clock
))
//
{
{
api_SetTimer5
(
22
,(
_Clock
*
)
&
g_Clock
);
//
api_SetTimer5
(
5
,(
_Clock
*
)
&
g_Clock
);
//10ms
g_bReturn
=
bsp_CANSendExtFrame
(
g_Msg0A30FFE8
.
id
,
g_Msg0A30FFE8
.
prio
,
g_Msg0A30FFE8
.
dlc
,
g_Msg0A30FFE8
.
data
);
// g_bReturn = bsp_CANSendExtFrame(g_Msg18F0010B.id,g_Msg18F0010B.prio,g_Msg18F0010B.dlc,g_Msg18F0010B.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg18F0010B.id,g_Msg18F0010B.prio,g_Msg18F0010B.dlc,g_Msg18F0010B.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg0CFED926.id,g_Msg0CFED926.prio,g_Msg0CFED926.dlc,g_Msg0CFED926.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg0CFED926.id,g_Msg0CFED926.prio,g_Msg0CFED926.dlc,g_Msg0CFED926.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg18FED800.id,g_Msg18FED800.prio,g_Msg18FED800.dlc,g_Msg18FED800.data); //1000
// g_bReturn = bsp_CANSendExtFrame(g_Msg18FED800.id,g_Msg18FED800.prio,g_Msg18FED800.dlc,g_Msg18FED800.data); //1000
...
@@ -242,6 +242,14 @@ void app_Can_IdInit(void)
...
@@ -242,6 +242,14 @@ void app_Can_IdInit(void)
g_Msg0C01FFAB
.
prio
=
0
;
g_Msg0C01FFAB
.
prio
=
0
;
g_Msg0C01FFAB
.
dlc
=
8
;
g_Msg0C01FFAB
.
dlc
=
8
;
g_Msg0A30FFE8
.
id
=
0X0A30FFE8
;
g_Msg0A30FFE8
.
prio
=
0
;
g_Msg0A30FFE8
.
dlc
=
8
;
g_Msg0A31FFE8
.
id
=
0X0A31FFE8
;
g_Msg0A31FFE8
.
prio
=
0
;
g_Msg0A31FFE8
.
dlc
=
8
;
g_Msg0CFED926
.
id
=
0X0CFED926
;
g_Msg0CFED926
.
id
=
0X0CFED926
;
g_Msg0CFED926
.
prio
=
0
;
g_Msg0CFED926
.
prio
=
0
;
g_Msg0CFED926
.
dlc
=
8
;
g_Msg0CFED926
.
dlc
=
8
;
...
@@ -661,6 +669,9 @@ void app_Can_handle_PA5(void) {
...
@@ -661,6 +669,9 @@ void app_Can_handle_PA5(void) {
g_Msg101
.
data
[
4
].
bbyte
=
0x0
;
g_Msg101
.
data
[
4
].
bbyte
=
0x0
;
g_Msg101
.
data
[
5
].
bbyte
=
0x0
;
g_Msg101
.
data
[
5
].
bbyte
=
0x0
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0x0
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x0
;
g_Msg0A30FFE8
.
data
[
0
].
bbyte
=
0x0
;
}
}
if
(
G_Button
.
LED_STEP
==
1
)
if
(
G_Button
.
LED_STEP
==
1
)
...
@@ -684,7 +695,10 @@ void app_Can_handle_PA5(void) {
...
@@ -684,7 +695,10 @@ void app_Can_handle_PA5(void) {
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0x10
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0x10
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0xBC
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x00
;
g_Msg0A30FFE8
.
data
[
0
].
bbyte
=
0x00
;
}
}
if
(
G_Button
.
LED_STEP
==
2
)
if
(
G_Button
.
LED_STEP
==
2
)
{
{
...
@@ -706,6 +720,9 @@ void app_Can_handle_PA5(void) {
...
@@ -706,6 +720,9 @@ void app_Can_handle_PA5(void) {
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0x80
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0x80
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0x72
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x01
;
}
}
if
(
G_Button
.
LED_STEP
==
3
)
if
(
G_Button
.
LED_STEP
==
3
)
{
{
...
@@ -727,6 +744,11 @@ g_Msg12B.data[2].bbyte=0x05;
...
@@ -727,6 +744,11 @@ g_Msg12B.data[2].bbyte=0x05;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0x30
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x02
;
g_Msg0A30FFE8
.
data
[
0
].
bbyte
=
0x00
;
}
}
if
(
G_Button
.
LED_STEP
==
4
)
if
(
G_Button
.
LED_STEP
==
4
)
{
{
...
@@ -749,7 +771,10 @@ g_Msg12B.data[2].bbyte=0x07;
...
@@ -749,7 +771,10 @@ g_Msg12B.data[2].bbyte=0x07;
g_Msg7E82
.
data
[
1
].
bbyte
=
0x41
;
g_Msg7E82
.
data
[
1
].
bbyte
=
0x41
;
g_Msg7E82
.
data
[
2
].
bbyte
=
0x01
;
g_Msg7E82
.
data
[
2
].
bbyte
=
0x01
;
g_Msg7E82
.
data
[
3
].
bbyte
=
0x80
;
g_Msg7E82
.
data
[
3
].
bbyte
=
0x80
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0xE6
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x02
;
g_Msg0A30FFE8
.
data
[
0
].
bbyte
=
0x08
;
}
}
if
(
G_Button
.
LED_STEP
==
5
)
if
(
G_Button
.
LED_STEP
==
5
)
{
{
...
@@ -772,6 +797,11 @@ g_Msg12B.data[2].bbyte=0x09;
...
@@ -772,6 +797,11 @@ g_Msg12B.data[2].bbyte=0x09;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0xA0
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x03
;
g_Msg0A30FFE8
.
data
[
0
].
bbyte
=
0x01
;
}
}
if
(
G_Button
.
LED_STEP
==
6
)
if
(
G_Button
.
LED_STEP
==
6
)
{
{
...
@@ -794,6 +824,11 @@ g_Msg12B.data[2].bbyte=0x0B;
...
@@ -794,6 +824,11 @@ g_Msg12B.data[2].bbyte=0x0B;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0x5A
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x04
;
g_Msg0A30FFE8
.
data
[
0
].
bbyte
=
0x00
;
}
}
if
(
G_Button
.
LED_STEP
==
7
)
if
(
G_Button
.
LED_STEP
==
7
)
{
{
...
@@ -815,6 +850,10 @@ g_Msg240.data[7].bbyte=240;
...
@@ -815,6 +850,10 @@ g_Msg240.data[7].bbyte=240;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0x10
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x05
;
}
}
if
(
G_Button
.
LED_STEP
>=
8
)
if
(
G_Button
.
LED_STEP
>=
8
)
{
{
...
@@ -837,6 +876,10 @@ g_Msg12B.data[2].bbyte=0x0D;
...
@@ -837,6 +876,10 @@ g_Msg12B.data[2].bbyte=0x0D;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0xCA
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x05
;
}
}
if
(
G_Button
.
LED_STEP
>=
9
)
if
(
G_Button
.
LED_STEP
>=
9
)
{
{
...
@@ -858,6 +901,10 @@ g_Msg12B.data[2].bbyte=0x0D;
...
@@ -858,6 +901,10 @@ g_Msg12B.data[2].bbyte=0x0D;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
2
].
bbyte
=
0x00
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
3
].
bbyte
=
0x05
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg7E8
.
data
[
4
].
bbyte
=
0xA0
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0x80
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x06
;
}
}
if
(
G_Button
.
LED_STEP
>=
10
)
if
(
G_Button
.
LED_STEP
>=
10
)
{
{
...
@@ -887,6 +934,11 @@ g_Msg12B.data[2].bbyte=0x0E;
...
@@ -887,6 +934,11 @@ g_Msg12B.data[2].bbyte=0x0E;
g_Msg7E82
.
data
[
1
].
bbyte
=
0x41
;
g_Msg7E82
.
data
[
1
].
bbyte
=
0x41
;
g_Msg7E82
.
data
[
2
].
bbyte
=
0x01
;
g_Msg7E82
.
data
[
2
].
bbyte
=
0x01
;
g_Msg7E82
.
data
[
3
].
bbyte
=
0x80
;
g_Msg7E82
.
data
[
3
].
bbyte
=
0x80
;
g_Msg0A31FFE8
.
data
[
0
].
bbyte
=
0x5B
;
g_Msg0A31FFE8
.
data
[
1
].
bbyte
=
0x07
;
g_Msg0A30FFE8
.
data
[
0
].
bbyte
=
0x09
;
}
}
if
(
G_Button
.
LED_STEP
>=
11
)
if
(
G_Button
.
LED_STEP
>=
11
)
{
{
...
...
bsp_Sources/bsp_RTC.c
View file @
80431918
...
@@ -50,11 +50,16 @@ interrupt void bsp_RTC_isr(void)
...
@@ -50,11 +50,16 @@ interrupt void bsp_RTC_isr(void)
if
((
G_Button
.
LED_STEP
>=
0
)
&&
(
G_Button
.
LED_STEP
<
MenuCn
))
if
((
G_Button
.
LED_STEP
>=
0
)
&&
(
G_Button
.
LED_STEP
<
MenuCn
))
{
{
G_Button
.
LED_STEP
++
;
G_Button
.
LED_STEP
++
;
if
(
g_FRStep
<
MenuCn
)
{
g_FRStep
++
;
}
}
}
else
else
{
{
G_Button
.
LED_STEP
=
0
;
G_Button
.
LED_STEP
=
0
;
g_FRStep
=
0
;
}
}
}
}
}
}
...
...
bsp_Sources/bsp_System.c
View file @
80431918
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : bsp_Sys_Init
* Function Name : bsp_Sys_Init
* Description : 系统
初始化
* Description : ϵͳ
��ʼ��
* Input : None
* Input : None
* Output : None
* Output : None
* Return : None
* Return : None
...
@@ -23,7 +23,7 @@ void bsp_Sys_Init(void)
...
@@ -23,7 +23,7 @@ void bsp_Sys_Init(void)
}
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : bsp_Clock_Init
* Function Name : bsp_Clock_Init
* Description : 系统时
钟初始化
* Description : ϵͳʱ
�ӳ�ʼ��
* Input : None
* Input : None
* Output : None
* Output : None
* Return : None
* Return : None
...
@@ -33,10 +33,10 @@ void bsp_Clock_Init(void)
...
@@ -33,10 +33,10 @@ void bsp_Clock_Init(void)
{
{
INT32U
dwTime
=
null
;
INT32U
dwTime
=
null
;
MODE
=
NormalChip
;
MODE
=
NormalChip
;
DIRECT
=
InitDIRECT
;
//
初始化直接页寄存器
DIRECT
=
InitDIRECT
;
//
��ʼ��ֱ��ҳ�Ĵ���
IVBR
=
InitIVBR
;
//
初始化中断向量基地
址
IVBR
=
InitIVBR
;
//
��ʼ���ж���������ַ
CPMUOSC_OSCE
=
Enable
;
//使
能外部振荡器
CPMUOSC_OSCE
=
Enable
;
//ʹ
���ⲿ����
while
(
!
CPMUFLG_UPOSC
)
//
等待振荡稳定
while
(
!
CPMUFLG_UPOSC
)
//
�ȴ����ȶ�
{
{
dwTime
++
;
dwTime
++
;
if
(
dwTime
>
10000
)
if
(
dwTime
>
10000
)
...
@@ -45,18 +45,18 @@ void bsp_Clock_Init(void)
...
@@ -45,18 +45,18 @@ void bsp_Clock_Init(void)
break
;
break
;
}
}
}
}
ECLKCTL_NECLK
=
Enable
;
//
禁止ECLK输出
ECLKCTL_NECLK
=
Enable
;
//
��ֹECLK���
CPMUPROT
=
InitCPMUPROT
;
//
禁止时钟保护
CPMUPROT
=
InitCPMUPROT
;
//
��ֹʱ�ӱ���
CPMUREFDIV
=
InitCPMUREFDIV
;
//
设置分频系数
CPMUREFDIV
=
InitCPMUREFDIV
;
//
���÷�Ƶϵ��
CPMUSYNR
=
InitCPMUSYNR
;
//
设置乘系数
CPMUSYNR
=
InitCPMUSYNR
;
//
���ó�ϵ��
CPMUPOSTDIV
=
InitCPMUPOSTDIV
;
//
设置分频参数
CPMUPOSTDIV
=
InitCPMUPOSTDIV
;
//
���÷�Ƶ����
CPMUPLL
=
InitCPMUPLL
;
//PLL频
率调节
CPMUPLL
=
InitCPMUPLL
;
//PLLƵ
�ʵ���
CPMUCOP
=
InitCPMUCOP
;
//
开启看门狗
CPMUCOP
=
InitCPMUCOP
;
//
��������
CPMUCLKS
=
InitCPMUCLKS
;
//
在停止模式下振荡运行 选择PLL时钟
CPMUCLKS
=
InitCPMUCLKS
;
//
��ֹͣģʽ�������� ѡ��PLLʱ��
CPMUCLKS_PLLSEL
=
Enable
;
CPMUCLKS_PLLSEL
=
Enable
;
CPMUOSC_OSCE
=
Enable
;
//使
能外部振荡器
CPMUOSC_OSCE
=
Enable
;
//ʹ
���ⲿ����
while
(
!
CPMUFLG_UPOSC
)
//
等待振荡稳定
while
(
!
CPMUFLG_UPOSC
)
//
�ȴ����ȶ�
{
{
dwTime
++
;
dwTime
++
;
_FEED_COP
();
_FEED_COP
();
...
@@ -67,18 +67,18 @@ void bsp_Clock_Init(void)
...
@@ -67,18 +67,18 @@ void bsp_Clock_Init(void)
}
}
}
}
CPMUCLKS_PSTP
=
Enable
;
//αֹͣģʽ
CPMUCLKS_PSTP
=
Enable
;
//αֹͣģʽ
CPMUCLKS_RTIOSCSEL
=
Enable
;
//RTI STOP MODE
继续运行
CPMUCLKS_RTIOSCSEL
=
Enable
;
//RTI STOP MODE
��������
CPMUCLKS_PRE
=
Enable
;
CPMUCLKS_PRE
=
Enable
;
CPMUCLKS_COPOSCSEL
=
!
Enable
;
//COP STOP MODE
运行
CPMUCLKS_COPOSCSEL
=
!
Enable
;
//COP STOP MODE
����
CPMUCLKS_PCE
=
!
Enable
;
CPMUCLKS_PCE
=
!
Enable
;
CPMUPROT
=
Enable
;
//使
能时钟保护
CPMUPROT
=
Enable
;
//ʹ
��ʱ�ӱ���
CPMUHTCTL
=
Disable
;
//
温度保护禁
止
CPMUHTCTL
=
Disable
;
//
�¶ȱ�����ֹ
//
中断
//
�ж�
CPMUINT_OSCIE
=
Disable
;
//Osc
CPMUINT_OSCIE
=
Disable
;
//Osc
CPMUINT_LOCKIE
=
Disable
;
//Lock
CPMUINT_LOCKIE
=
Disable
;
//Lock
//RTI
//RTI
CPMURTI_RTDEC
=
True
;
//十
进制
CPMURTI_RTDEC
=
True
;
//ʮ
����
CPMURTI_RTR
=
0x57
;
//400*10^3 0X57 4M 0x5F 8M 800 *10^4
CPMURTI_RTR
=
0x57
;
//400*10^3 0X57 4M 0x5F 8M 800 *10^4
CPMUINT_RTIE
=
Enable
;
//RTI
CPMUINT_RTIE
=
Enable
;
//RTI
...
@@ -107,7 +107,7 @@ void GJ_CS10_JS_ECUOUT_N(void)
...
@@ -107,7 +107,7 @@ void GJ_CS10_JS_ECUOUT_N(void)
CS_FR_BASIC
=
((
INT32U
)
695
*
8
*
10
)
/
3600
;
CS_FR_BASIC
=
((
INT32U
)
695
*
8
*
10
)
/
3600
;
//glz--20170428
车速
PWM
//glz--20170428
����PW
M
if
(
g_FRStep
==
0
)
if
(
g_FRStep
==
0
)
{
{
CS_FR
=
7812
;
//1HZ
CS_FR
=
7812
;
//1HZ
...
@@ -117,46 +117,56 @@ void GJ_CS10_JS_ECUOUT_N(void)
...
@@ -117,46 +117,56 @@ void GJ_CS10_JS_ECUOUT_N(void)
if
(
g_FRStep
==
1
)
if
(
g_FRStep
==
1
)
{
{
CS_FR
=
326
;
//20KM //===== CS_FR=651;10KM 12HZ =====//
//
CS_FR=326; //20KM //===== CS_FR=651;10KM 12HZ =====//
ZS_FR
=
234
;
//8.33hz
1000r
ZS_FR
=
467
;
//
1000r
}
}
if
(
g_FRStep
==
2
)
if
(
g_FRStep
==
2
)
{
{
CS_FR
=
163
;
//40KM
//
CS_FR=163; //40KM
ZS_FR
=
117
;
//16.66hz
2000r
ZS_FR
=
234
;
//
2000r
}
}
if
(
g_FRStep
==
3
)
if
(
g_FRStep
==
3
)
{
{
CS_FR
=
108
;
//60KM
//
CS_FR=108; //60KM
ZS_FR
=
78
;
//3000
ZS_FR
=
156
;
//3000
}
}
if
(
g_FRStep
==
4
)
if
(
g_FRStep
==
4
)
{
{
CS_FR
=
81
;
//80KM
//
CS_FR=81; //80KM
ZS_FR
=
58
;
//4000
ZS_FR
=
117
;
//4000r
}
}
if
(
g_FRStep
==
5
)
if
(
g_FRStep
==
5
)
{
{
CS_FR
=
65
;
//100KM
//
CS_FR=65; //100KM
ZS_FR
=
47
;
//5000
ZS_FR
=
94
;
//5000
}
}
if
(
g_FRStep
==
6
)
if
(
g_FRStep
==
6
)
{
{
CS_FR
=
54
;
//120KM
//
CS_FR=54; //120KM
ZS_FR
=
39
;
//6000
ZS_FR
=
78
;
//6000
}
}
if
(
g_FRStep
==
7
)
if
(
g_FRStep
==
7
)
{
{
CS_FR
=
47
;
//140KM
//
CS_FR=47; //140KM
ZS_FR
=
33
;
//7000
ZS_FR
=
67
;
//7000
}
}
if
(
g_FRStep
==
8
)
if
(
g_FRStep
==
8
)
{
{
CS_FR
=
30
;
//160KM
// CS_FR=30; //160KM
ZS_FR
=
31
;
//7600
ZS_FR
=
58
;
//8000
}
}
if
(
g_FRStep
==
9
)
{
// CS_FR=30; //160KM
ZS_FR
=
52
;
//9000
}
if
(
g_FRStep
==
10
)
{
// CS_FR=30; //160KM
ZS_FR
=
45
;
//9000
}
/* //====1/2
表盘
=======//
/* //====1/2
����==
=====//
if(g_FRStep==9)
if(g_FRStep==9)
{
{
...
@@ -272,20 +282,20 @@ interrupt void bsp_API_isr(void)
...
@@ -272,20 +282,20 @@ interrupt void bsp_API_isr(void)
}
}
//
车速表
//
���ٱ�
CZBTIME0_6MSCCFF
=!
CZBTIME0_6MSCCFF
;
CZBTIME0_6MSCCFF
=!
CZBTIME0_6MSCCFF
;
if
(
CZBTIME0_6MSCCFF
)
//
【应该是128us】
if
(
CZBTIME0_6MSCCFF
)
//
��Ӧ����128us��
{
{
if
(
++
iTIME1MS
==
8
)
//1.024MS
if
(
++
iTIME1MS
==
8
)
//1.024MS
{
{
T1MS_F1_FF
=
1
;
//1MS
标志(用于水油表走动
)
T1MS_F1_FF
=
1
;
//1MS
��־(����ˮ�ͱ��߶�)
iTIME1MS
=
0
;
iTIME1MS
=
0
;
iTIME2MS
=!
iTIME2MS
;
iTIME2MS
=!
iTIME2MS
;
if
(
iTIME2MS
)
if
(
iTIME2MS
)
{
{
T2MS_F2_FF
=
1
;
//2MS
标志(用于车速表输入脉冲超长监测
)
T2MS_F2_FF
=
1
;
//2MS
��־(���ڳ��ٱ��������峬�����)
T2MS_F9_FF
=
1
;
//2MS
标志(任务时间标志
)
T2MS_F9_FF
=
1
;
//2MS
��־(����ʱ���־)
}
}
}
}
...
@@ -299,17 +309,17 @@ interrupt void bsp_API_isr(void)
...
@@ -299,17 +309,17 @@ interrupt void bsp_API_isr(void)
//-------------------------------------------------------------------------------
//-------------------------------------------------------------------------------
void
Api_API_Init
(
INT8U
tog
)
void
Api_API_Init
(
INT8U
tog
)
{
{
//
自主周期中断时间
//
���������ж�ʱ��
CPMUAPICTL_APICLK
=
1
;
//Bus Clock
做为 自主周期中断的时钟
源
CPMUAPICTL_APICLK
=
1
;
//Bus Clock
��Ϊ ���������жϵ�ʱ��Դ
CPMUAPIR
=
1023
;
//
自主周期中断周期
=2*(1023+1)*(1/32M)=64US +++++++++
CPMUAPIR
=
1023
;
//
�������������=2*(102
3+1)*(1/32M)=64US +++++++++
CPMUAPICTL_APIFE
=
1
;
//使
能自主周期中断功能,并开始计
时
CPMUAPICTL_APIFE
=
1
;
//ʹ
�����������жϹ���,����ʼ��ʱ
//----------------------------- //306ҳ
//----------------------------- //306ҳ
if
(
tog
)
CPMUAPICTL_APIE
=
1
;
//
开自主周期中断
if
(
tog
)
CPMUAPICTL_APIE
=
1
;
//
�����������ж�
else
CPMUAPICTL_APIE
=
0
;
//
开自主周期中断
else
CPMUAPICTL_APIE
=
0
;
//
�����������ж�
}
}
...
...
gui_Sources/gui_Display.c
View file @
80431918
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* Function Name : gui_LCD_Display
* Function Name : gui_LCD_Display
* Description : LCD
ʾ
* Description : LCD
��ʾ
* Input : None
* Input : None
* Output : None
* Output : None
* Return : None
* Return : None
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
void
gui_LCD_Display
(
void
)
void
gui_LCD_Display
(
void
)
{
{
//
λ
//
��λ
m_LCDFP17BP
=
Matrix1
[
G_Button
.
LED_STEP
/
10
]
>>
4
;
m_LCDFP17BP
=
Matrix1
[
G_Button
.
LED_STEP
/
10
]
>>
4
;
m_LCDFP18BP
=
Matrix1
[
G_Button
.
LED_STEP
/
10
];
m_LCDFP18BP
=
Matrix1
[
G_Button
.
LED_STEP
/
10
];
...
@@ -84,7 +84,7 @@ void gui_LCD_Display(void)
...
@@ -84,7 +84,7 @@ void gui_LCD_Display(void)
void
Gui_ButtonProc
(
_Button
*
KeyMenu
)
void
Gui_ButtonProc
(
_Button
*
KeyMenu
)
{
{
/**lamp+**/
/**lamp+**/
//D
̰
//D
�̰�
if
(
KeyAddIn
==
HIGH
)
if
(
KeyAddIn
==
HIGH
)
{
{
if
((
KeyMenu
->
PushTime1
>=
T_100ms
)
&&
(
KeyMenu
->
PushTime1
<
T_2s
))
if
((
KeyMenu
->
PushTime1
>=
T_100ms
)
&&
(
KeyMenu
->
PushTime1
<
T_2s
))
...
@@ -93,24 +93,29 @@ void Gui_ButtonProc(_Button* KeyMenu)
...
@@ -93,24 +93,29 @@ void Gui_ButtonProc(_Button* KeyMenu)
if
((
G_Button
.
LED_STEP
>=
0
)
&&
(
G_Button
.
LED_STEP
<
MenuCn
))
if
((
G_Button
.
LED_STEP
>=
0
)
&&
(
G_Button
.
LED_STEP
<
MenuCn
))
{
{
G_Button
.
LED_STEP
++
;
G_Button
.
LED_STEP
++
;
if
(
g_FRStep
<
MenuCn
)
{
g_FRStep
++
;
}
}
}
else
else
{
{
G_Button
.
LED_STEP
=
0
;
G_Button
.
LED_STEP
=
0
;
g_FRStep
=
0
;
}
}
KeyMenu
->
PushTime1
=
null
;
KeyMenu
->
PushTime1
=
null
;
}
}
}
}
//̧
//̧
��
if
(
KeyAddIn
==
HIGH
)
if
(
KeyAddIn
==
HIGH
)
{
{
KeyMenu
->
PushTime1
=
null
;
KeyMenu
->
PushTime1
=
null
;
}
}
/**lamp-**/
/**lamp-**/
//D
̰
//D
�̰�
if
(
KeySubIn
==
HIGH
)
if
(
KeySubIn
==
HIGH
)
{
{
if
((
KeyMenu
->
PushTime2
>=
T_100ms
)
&&
(
KeyMenu
->
PushTime2
<
T_2s
))
if
((
KeyMenu
->
PushTime2
>=
T_100ms
)
&&
(
KeyMenu
->
PushTime2
<
T_2s
))
...
@@ -119,17 +124,22 @@ void Gui_ButtonProc(_Button* KeyMenu)
...
@@ -119,17 +124,22 @@ void Gui_ButtonProc(_Button* KeyMenu)
if
(
G_Button
.
LED_STEP
==
0
)
if
(
G_Button
.
LED_STEP
==
0
)
{
{
G_Button
.
LED_STEP
=
MenuCn
;
G_Button
.
LED_STEP
=
MenuCn
;
g_FRStep
=
MenuCn
;
}
}
else
if
((
G_Button
.
LED_STEP
>
0
)
&&
(
G_Button
.
LED_STEP
<=
MenuCn
))
else
if
((
G_Button
.
LED_STEP
>
0
)
&&
(
G_Button
.
LED_STEP
<=
MenuCn
))
{
{
G_Button
.
LED_STEP
--
;
G_Button
.
LED_STEP
--
;
if
((
g_FRStep
>
0
)
&&
(
g_FRStep
<=
MenuCn
))
{
g_FRStep
--
;
}
}
}
KeyMenu
->
PushTime2
=
null
;
KeyMenu
->
PushTime2
=
null
;
}
}
}
}
//̧
//̧
��
if
(
KeySubIn
==
HIGH
)
if
(
KeySubIn
==
HIGH
)
{
{
KeyMenu
->
PushTime2
=
null
;
KeyMenu
->
PushTime2
=
null
;
...
...
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