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
7d6bd508
Commit
7d6bd508
authored
May 27, 2025
by
huangguoqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加自走模式,打点模式,控制15电,NFCkaguanji v100banben
parent
d08ff987
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
174 additions
and
153 deletions
+174
-153
Barcode_Scanner.c
YueJin_test_bench/source/Appliciation/Barcode_Scanner.c
+11
-11
CAN_APP.c
YueJin_test_bench/source/Appliciation/CAN_APP.c
+4
-94
Display_Info.c
YueJin_test_bench/source/Appliciation/Display_Info.c
+20
-6
Key.h
YueJin_test_bench/source/Appliciation/Key.h
+2
-2
Key_user.c
YueJin_test_bench/source/Appliciation/Key_user.c
+87
-38
RTE_GPIO.c
YueJin_test_bench/source/Appliciation/RTE_GPIO.c
+22
-0
RTE_GPIO.h
YueJin_test_bench/source/Appliciation/RTE_GPIO.h
+4
-1
Task.c
YueJin_test_bench/source/Appliciation/Task.c
+24
-1
No files found.
YueJin_test_bench/source/Appliciation/Barcode_Scanner.c
View file @
7d6bd508
...
...
@@ -64,17 +64,17 @@ void datacheck(void)
{
uint8_t
dataopenBuff
[
11
]
=
{
0x07
,
0x36
,
0xAD
,
0x0F
,
0x0F
,
0x11
,
0x01
,
0x02
,
0x03
,
0x04
,
0xE6
};
uint8_t
datacloseBuff
[
11
]
=
{
0x07
,
0x36
,
0x33
,
0x0F
,
0x0F
,
0x11
,
0x01
,
0x02
,
0x03
,
0x04
,
0x6C
};
//
if(memcmp(BarCode,dataopenBuff,11) == 0)
//
{
//
POWER_CTRL_KL15 = 1;
//
}
//
else
//
{
//
if(memcmp(BarCode,datacloseBuff,11) == 0)
//
{
//
POWER_CTRL_KL15 = 0;
//
}
//
}
if
(
memcmp
(
BarCode
,
dataopenBuff
,
11
)
==
0
)
{
POWER_CTRL_KL15
=
1
;
}
else
{
if
(
memcmp
(
BarCode
,
datacloseBuff
,
11
)
==
0
)
{
POWER_CTRL_KL15
=
0
;
}
}
memset
(
BarCode
,
0
,
sizeof
(
BarCode
));
...
...
YueJin_test_bench/source/Appliciation/CAN_APP.c
View file @
7d6bd508
...
...
@@ -36,12 +36,10 @@ uint8_t CrcCheckSum(uint8_t *data, uint8_t len)
void
CAN_MSG_COUNTER_PLUS
(
void
)
{
}
uint8_t
VSpeed
=
0
;
void
Can_Set_Buff_200
(
uint8_t
CopyData
[])
{
uint8_t
i
=
0u
;
uint32_t
wtemp
=
0u
;
VSpeed
=
0
;
CANMsg220Union
*
pCANMsg
;
pCANMsg
=
(
CANMsg220Union
*
)
CopyData
;
...
...
@@ -53,46 +51,8 @@ void Can_Set_Buff_200(uint8_t CopyData [])
pCANMsg
->
Msg
[
i
]
=
0u
;
}
}
switch
(
Check_Steps
)
{
case
0
:
VSpeed
=
0
;
break
;
case
1
:
VSpeed
=
10
;
break
;
case
2
:
VSpeed
=
19
;
break
;
case
3
:
VSpeed
=
29
;
break
;
case
4
:
VSpeed
=
38
;
break
;
case
5
:
VSpeed
=
47
;
break
;
case
6
:
VSpeed
=
57
;
break
;
case
7
:
VSpeed
=
75
;
break
;
case
8
:
VSpeed
=
88
;
break
;
case
9
:
VSpeed
=
88
;
break
;
case
10
:
VSpeed
=
88
;
break
;
case
11
:
VSpeed
=
88
;
break
;
}
pCANMsg
->
Sig
.
Vspeeed
=
VSpeed
;
pCANMsg
->
Sig
.
Vspeeed
=
Vspeed
;
}
void
Can_Set_Buff_481
(
uint8_t
CopyData
[])
...
...
@@ -134,60 +94,10 @@ void Can_Set_Buff_020(uint8_t CopyData [])
pCANMsg
->
Msg
[
i
]
=
0u
;
}
}
switch
(
Check_Steps
)
{
case
0
:
pCANMsg
->
Sig
.
Eletricity_H
=
0
;
pCANMsg
->
Sig
.
Eletricity_L
=
0
;
break
;
case
1
:
pCANMsg
->
Sig
.
Eletricity_H
=
0
;
pCANMsg
->
Sig
.
Eletricity_L
=
0
;
break
;
case
2
:
pCANMsg
->
Sig
.
Eletricity_H
=
0
;
pCANMsg
->
Sig
.
Eletricity_L
=
0x96
;
break
;
case
3
:
pCANMsg
->
Sig
.
Eletricity_H
=
0x01
;
pCANMsg
->
Sig
.
Eletricity_L
=
0x5E
;
break
;
case
4
:
pCANMsg
->
Sig
.
Eletricity_H
=
0x02
;
pCANMsg
->
Sig
.
Eletricity_L
=
0x26
;
break
;
case
5
:
pCANMsg
->
Sig
.
Eletricity_H
=
0x02
;
pCANMsg
->
Sig
.
Eletricity_L
=
0xEE
;
break
;
case
6
:
pCANMsg
->
Sig
.
Eletricity_H
=
0x03
;
pCANMsg
->
Sig
.
Eletricity_L
=
0xE8
;
break
;
case
7
:
pCANMsg
->
Sig
.
Eletricity_H
=
0x02
;
pCANMsg
->
Sig
.
Eletricity_L
=
0xEE
;
break
;
case
8
:
pCANMsg
->
Sig
.
Eletricity_H
=
0x02
;
pCANMsg
->
Sig
.
Eletricity_L
=
0x26
;
break
;
case
9
:
pCANMsg
->
Sig
.
Eletricity_H
=
0x01
;
pCANMsg
->
Sig
.
Eletricity_L
=
0x5E
;
break
;
case
10
:
pCANMsg
->
Sig
.
Eletricity_H
=
0
;
pCANMsg
->
Sig
.
Eletricity_L
=
0x96
;
break
;
case
11
:
pCANMsg
->
Sig
.
Eletricity_H
=
0x03
;
pCANMsg
->
Sig
.
Eletricity_L
=
0xE8
;
break
;
}
pCANMsg
->
Sig
.
Eletricity_H
=
Eletricity
>>
8
;
pCANMsg
->
Sig
.
Eletricity_L
=
Eletricity
&
0xff
;
}
void
Can_Set_Buff_042
(
uint8_t
CopyData
[])
...
...
YueJin_test_bench/source/Appliciation/Display_Info.c
View file @
7d6bd508
...
...
@@ -2915,10 +2915,21 @@ uint32_t Get_Display_Type(void)
uint8_t
Check_StepsAxis
[
2
]
=
{
250
,
240
};;
uint8_t
Check_VspeeedAxis
[
2
]
=
{
165
,
155
};
uint16_t
Clear_TFT_Time
=
0
;
uint16_t
Version
=
100
;
void
Display_PageNum
(
void
)
{
Display_Num
(
200
,
20
,
Check_Steps
,
100
);
//步骤
Display_Num
(
200
,
20
,
Check_Steps
,
100
);
//步骤
Clear_TFT_Time
+=
100
;
if
(
Clear_TFT_Time
>=
1000
)
{
Clear_TFT_Time
=
0
;
Display_TFT_Clear
(
);
Display_Num
(
200
,
20
,
Check_Steps
,
100
);
//步骤
Display_Num
(
20
,
280
,
Version
,
100
);
//步骤
}
}
uint16_t
Display_Time
=
0
;
void
Display_Num
(
uint16_t
StartX
,
uint16_t
StartY
,
uint16_t
m_NUM
,
uint8_t
CbkCycle
)
...
...
@@ -2931,7 +2942,7 @@ void Display_Num(uint16_t StartX, uint16_t StartY,uint16_t m_NUM,uint8_t CbkCycl
Num
=
m_NUM
;
TempX
=
StartX
;
Display_Time
+=
CbkCycle
;
Display_Time
=
1000
;
if
(
Display_Time
>=
1000
)
{
Display_Time
=
0
;
...
...
@@ -2941,16 +2952,18 @@ void Display_Num(uint16_t StartX, uint16_t StartY,uint16_t m_NUM,uint8_t CbkCycl
}
//千位
Num
=
(
uint16_t
)((
m_NUM
/
1000u
)
%
10u
);
TempX
=
StartX
;
if
((
TempCount
==
4
)
&&
(
Num
>
0
))
{
TempX
=
TempX
-
1
0
;
TempX
=
TempX
-
3
0
;
TFT_LCD_Draw_Bmp
(
TempX
,
StartY
,
(
uint8_t
*
)
FONT_TABLE_15
[
Num
]);
}
//百位
Num
=
(
uint16_t
)((
m_NUM
/
100u
)
%
10u
);
TempX
=
StartX
;
if
(
TempCount
==
4
)
{
TempX
=
TempX
-
1
0
;
TempX
=
TempX
-
2
0
;
TFT_LCD_Draw_Bmp
(
TempX
,
StartY
,
(
uint8_t
*
)
FONT_TABLE_15
[
Num
]);
}
...
...
@@ -2958,12 +2971,13 @@ void Display_Num(uint16_t StartX, uint16_t StartY,uint16_t m_NUM,uint8_t CbkCycl
{
if
((
TempCount
==
3
)
&&
(
Num
>
0
))
{
TempX
=
TempX
-
1
0
;
TempX
=
TempX
-
2
0
;
TFT_LCD_Draw_Bmp
(
TempX
,
StartY
,
(
uint8_t
*
)
FONT_TABLE_15
[
Num
]);
}
}
//十位
Num
=
(
uint16_t
)((
m_NUM
/
10u
)
%
10u
);
TempX
=
StartX
;
if
(
TempCount
>
2
)
{
TempX
=
TempX
-
10
;
...
...
YueJin_test_bench/source/Appliciation/Key.h
View file @
7d6bd508
...
...
@@ -3,7 +3,7 @@
#include "TYW_stdint.h"
#define Check_KeepTime
1
000 //每个步骤保持时间
#define Check_KeepTime
3
000 //每个步骤保持时间
#define Check_Couont 11 //多少个步骤
...
...
@@ -87,7 +87,7 @@ extern Key_Set_en_t Key_Parameter_Set_Long_Press_Time(uint16_t u16Time);
extern
Key_Set_en_t
Key_Parameter_Set_Super_Long_Press_Time
(
uint32_t
u32Time
);
extern
uint8_t
Check_Steps
;
extern
void
User_CheckMode_Service
(
uint8_t
CbkCycle
);
extern
void
User_CanSend
(
uint8_t
steps
);
extern
uint8_t
Vspeed
;
extern
uint8_t
Signal_4G
;
...
...
YueJin_test_bench/source/Appliciation/Key_user.c
View file @
7d6bd508
...
...
@@ -8,12 +8,34 @@
uint8_t
Check_Steps
=
0
;
uint8_t
Check_Control_Mode
=
2
;
// 1 自走模式 2 打点模式 0 默认都发0
uint8_t
Check_Control_Time
=
0
;
uint16_t
Check_Control_Time
=
0
;
uint8_t
Vspeed
=
0
;
uint8_t
Signal_4G
=
0
;
uint8_t
Signal_GPS
=
0
;
uint16_t
Eletricity
=
0
;
uint8_t
Hour
=
0
;
uint8_t
Tcs
=
0
;
uint8_t
Energy_recovery
=
0
;
uint8_t
Gear
=
0
;
uint8_t
Ready
=
0
;
uint8_t
Cruiste
=
0
;
uint8_t
Fault
=
0
;
uint8_t
Motor_hert
=
0
;
uint8_t
Battery_temp
=
0
;
void
Key_Operation_SW1
(
Key_Event_en_t
enKeyEvent
)
{
/*清零ODO*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
if
(
POWER_CTRL_KL15
==
1
)
{
POWER_CTRL_KL15
=
0
;
}
else
{
POWER_CTRL_KL15
=
1
;
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
...
...
@@ -309,7 +331,7 @@ Key_Real_Status_en_t Key_Real_sw10(void)
void
User_CheckMode_Service
(
uint8_t
CbkCycle
)
{
if
(
Check_Control_Mode
==
2
)
if
(
Check_Control_Mode
==
1
)
{
Check_Control_Time
+=
CbkCycle
;
...
...
@@ -323,23 +345,8 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Check_Steps
=
0
;
}
}
}
uint8_t
Vspeed
=
0
;
uint8_t
Signal_4G
=
0
;
uint8_t
Signal_GPS
=
0
;
uint16_t
Eletricity
=
0
;
uint8_t
Hour
=
0
;
uint8_t
Tcs
=
0
;
uint8_t
Energy_recovery
=
0
;
uint8_t
Gear
=
0
;
uint8_t
Ready
=
0
;
uint8_t
Cruiste
=
0
;
uint8_t
Fault
=
0
;
uint8_t
Motor_hert
=
0
;
uint8_t
Battery_temp
=
0
;
void
User_CanSend
(
void
)
{
switch
(
Check_Steps
)
{
...
...
@@ -357,7 +364,11 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
0
;
break
;
case
1
:
Vspeed
=
10
;
Signal_4G
=
0
;
...
...
@@ -372,12 +383,15 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Left_Led
=
1
;
Right_Led
=
1
;
Headlights_Led
=
0
;
break
;
case
2
:
Vspeed
=
19
;
Signal_4G
=
0
;
Signal_GPS
=
0
;
Eletricity
=
15
;
Eletricity
=
15
0
;
Hour
=
4
;
Tcs
=
0
;
Energy_recovery
=
0
;
...
...
@@ -387,12 +401,15 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
1
;
break
;
case
3
:
Vspeed
=
29
;
Signal_4G
=
0
;
Signal_GPS
=
0
;
Eletricity
=
35
;
Eletricity
=
35
0
;
Hour
=
6
;
Tcs
=
0
;
Energy_recovery
=
0
;
...
...
@@ -402,12 +419,15 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
1
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
0
;
break
;
case
4
:
Vspeed
=
38
;
Signal_4G
=
0
;
Signal_GPS
=
0
;
Eletricity
=
55
;
Eletricity
=
55
0
;
Hour
=
8
;
Tcs
=
0
;
Energy_recovery
=
0
;
...
...
@@ -417,12 +437,15 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
0
;
break
;
case
5
:
Vspeed
=
47
;
Signal_4G
=
0
;
Signal_GPS
=
0
;
Eletricity
=
75
;
Eletricity
=
75
0
;
Hour
=
10
;
Tcs
=
0
;
Energy_recovery
=
2
;
...
...
@@ -432,12 +455,15 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
0
;
break
;
case
6
:
Vspeed
=
57
;
Signal_4G
=
0
;
Signal_GPS
=
0
;
Eletricity
=
100
;
Eletricity
=
100
0
;
Hour
=
12
;
Tcs
=
2
;
Energy_recovery
=
1
;
...
...
@@ -447,12 +473,15 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
0
;
break
;
case
7
:
Vspeed
=
75
;
Signal_4G
=
0
;
Signal_GPS
=
0
;
Eletricity
=
75
;
Eletricity
=
75
0
;
Hour
=
14
;
Tcs
=
0
;
Energy_recovery
=
3
;
...
...
@@ -462,12 +491,15 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
0
;
break
;
case
8
:
Vspeed
=
88
;
Signal_4G
=
0
;
Signal_GPS
=
0
;
Eletricity
=
55
;
Eletricity
=
55
0
;
Hour
=
16
;
Tcs
=
0
;
Energy_recovery
=
0
;
...
...
@@ -477,12 +509,15 @@ void User_CanSend(void)
Fault
=
1
;
Motor_hert
=
1
;
Battery_temp
=
0
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
0
;
break
;
case
9
:
Vspeed
=
88
;
Signal_4G
=
0
;
Signal_GPS
=
65
;
Eletricity
=
35
;
Eletricity
=
35
0
;
Hour
=
18
;
Tcs
=
0
;
Energy_recovery
=
0
;
...
...
@@ -492,12 +527,15 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
0
;
break
;
case
10
:
Vspeed
=
88
;
Signal_4G
=
65
;
Signal_GPS
=
0
;
Eletricity
=
15
;
Eletricity
=
15
0
;
Hour
=
20
;
Tcs
=
0
;
Energy_recovery
=
0
;
...
...
@@ -507,25 +545,36 @@ void User_CanSend(void)
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Left_Led
=
0
;
Right_Led
=
0
;
Headlights_Led
=
0
;
break
;
case
11
:
Vspeed
=
88
;
Signal_4G
=
0
;
Signal_GPS
=
0
;
Eletricity
=
100
;
Hour
=
0
;
Signal_4G
=
65
;
Signal_GPS
=
65
;
Eletricity
=
100
0
;
Hour
=
1
;
Tcs
=
1
;
Energy_recovery
=
0
;
Gear
=
0
;
Ready
=
0
;
Cruiste
=
0
;
Fault
=
0
;
Motor_hert
=
0
;
Battery_temp
=
0
;
Energy_recovery
=
1
;
Gear
=
1
;
Ready
=
3
;
Cruiste
=
1
;
Fault
=
1
;
Motor_hert
=
1
;
Battery_temp
=
1
;
Left_Led
=
1
;
Right_Led
=
1
;
Headlights_Led
=
1
;
break
;
}
}
void
User_CanSend
(
uint8_t
steps
)
{
}
/*---------------------------------------------------------------------------------------*/
...
...
YueJin_test_bench/source/Appliciation/RTE_GPIO.c
View file @
7d6bd508
...
...
@@ -156,6 +156,28 @@ void RTE_GPIO_Init(void)
gpio_temp
.
enGPIOAltFun
=
GPIO_ALTER_FUN_1
;
GPIO_Config
(
&
gpio_temp
);
gpio_temp
.
enGPIOPort
=
GPIO_PORT_GROUP_AP0
;
//左转
gpio_temp
.
enGPIOPIN
=
GPIO_PIN_15
;
gpio_temp
.
enGPIOMode
=
GPIO_MODE_PORT
;
gpio_temp
.
enGPIODir
=
GPIO_DIR_OUT
;
gpio_temp
.
enGPIOAltFun
=
GPIO_ALTER_FUN_1
;
GPIO_Config
(
&
gpio_temp
);
gpio_temp
.
enGPIOPort
=
GPIO_PORT_GROUP_10
;
//右转
gpio_temp
.
enGPIOPIN
=
GPIO_PIN_14
;
gpio_temp
.
enGPIOMode
=
GPIO_MODE_PORT
;
gpio_temp
.
enGPIODir
=
GPIO_DIR_OUT
;
gpio_temp
.
enGPIOAltFun
=
GPIO_ALTER_FUN_1
;
GPIO_Config
(
&
gpio_temp
);
gpio_temp
.
enGPIOPort
=
GPIO_PORT_GROUP_10
;
//远光灯
gpio_temp
.
enGPIOPIN
=
GPIO_PIN_13
;
gpio_temp
.
enGPIOMode
=
GPIO_MODE_PORT
;
gpio_temp
.
enGPIODir
=
GPIO_DIR_OUT
;
gpio_temp
.
enGPIOAltFun
=
GPIO_ALTER_FUN_1
;
GPIO_Config
(
&
gpio_temp
);
//GPIO_OUT_PORT10_PIN13 = 1;
queren
=
0
;
LINE_OUT_POS_06
=
0
;
...
...
YueJin_test_bench/source/Appliciation/RTE_GPIO.h
View file @
7d6bd508
...
...
@@ -46,10 +46,13 @@
#define LINE_OUT_EPS GPIO_OUT_PORT10_PIN06
#define Light_Out GPIO_IN_PORT10_PIN09
#define Left_Led GPIO_OUT_APORT00_PIN15//左
#define Right_Led GPIO_OUT_PORT10_PIN14//右
#define Headlights_Led GPIO_OUT_PORT10_PIN13 //远光
#define POWER_CTRL_KL30 GPIO_OUT_PORT09_PIN05
#define POWER_CTRL_KL30_B
GPIO_OUT_PORT09_PIN04
#define POWER_CTRL_KL30_B GPIO_OUT_PORT09_PIN04
#define POWER_CTRL_KL15 GPIO_OUT_PORT09_PIN06
...
...
YueJin_test_bench/source/Appliciation/Task.c
View file @
7d6bd508
...
...
@@ -117,14 +117,37 @@ uint8_t showtime = 0;
uint8_t
bleuarttime
=
0
;
uint16_t
time5s
=
0
;
uint16_t
IGFLAG
=
0
;
uint16_t
testtime
=
0
;
void
Sys_Run_Mode_100ms_Tasks_Group
(
void
)
{
Display_PageNum
();
Display_Send_Vspead
();
User_CheckMode_Service
(
100u
);
//TFT_LCD_Draw_Bmp(3, 40, ( uint8_t * )gImage_Dsy_words_1X6_Y16);
POWER_CTRL_KL30
=
1
;
POWER_CTRL_KL30_B
=
1
;
POWER_CTRL_KL15
=
1
;
testtime
++
;
// if((testtime > 0)&&(testtime < 20))
// {
// Left_Led = 1;
// Right_Led = 1;
// Headlights_Led = 1;
// }
// else
// {
// Left_Led = 0;
// Right_Led = 0;
// Headlights_Led = 0;
// }
// if(testtime > 40)
// {
// testtime = 0;
// }
}
/*=================================================================*/
...
...
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