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
3e74870b
Commit
3e74870b
authored
Aug 27, 2025
by
何锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加蓝牙按键,增加扫码读码
parent
189fa3ca
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
276 additions
and
325 deletions
+276
-325
Barcode_Scanner.c
YueJin_test_bench/source/Appliciation/Barcode_Scanner.c
+147
-159
Barcode_Scanner.h
YueJin_test_bench/source/Appliciation/Barcode_Scanner.h
+2
-0
Check_Ctrl.c
YueJin_test_bench/source/Appliciation/Check_Ctrl.c
+19
-19
Display_Info.c
YueJin_test_bench/source/Appliciation/Display_Info.c
+1
-1
Key.h
YueJin_test_bench/source/Appliciation/Key.h
+1
-0
Key_user.c
YueJin_test_bench/source/Appliciation/Key_user.c
+47
-2
R485_Communication_Matrix.c
...est_bench/source/Appliciation/R485_Communication_Matrix.c
+14
-89
R485_Communication_Matrix.h
...est_bench/source/Appliciation/R485_Communication_Matrix.h
+0
-1
Task.c
YueJin_test_bench/source/Appliciation/Task.c
+5
-3
api_RS485.c
YueJin_test_bench/source/Appliciation/api_RS485.c
+38
-51
api_RS485.h
YueJin_test_bench/source/Appliciation/api_RS485.h
+2
-0
No files found.
YueJin_test_bench/source/Appliciation/Barcode_Scanner.c
View file @
3e74870b
This diff is collapsed.
Click to expand it.
YueJin_test_bench/source/Appliciation/Barcode_Scanner.h
View file @
3e74870b
...
...
@@ -39,4 +39,6 @@ extern uint8_t firstpowerflag;
extern
uint16_t
lightnumber
;
extern
uint8_t
btmac
[
6
];
extern
uint8_t
writeflag
;
extern
uint8_t
saomafinish
;
extern
uint8_t
mimaread
[
35
];
#endif
\ No newline at end of file
YueJin_test_bench/source/Appliciation/Check_Ctrl.c
View file @
3e74870b
...
...
@@ -76,10 +76,10 @@ void MENU_CHECK_STEP_ADD(void)
{
MENU_CHECK_STEP
=
0
;
}
if
((
guangganflag
==
2
||
guangganflag
==
1
)
&&
guangganflag
!=
3
)
{
MENU_CHECK_STEP
=
3
;
}
//
if((guangganflag == 2 || guangganflag == 1 ) && guangganflag != 3)
//
{
//
MENU_CHECK_STEP = 3;
//
}
}
void
MENU_CHECK_STEP_SUB
(
void
)
{
...
...
@@ -240,16 +240,22 @@ uint8_t yibiaoshuju[34];
// {
// erweima[i] = barcode_Msg[i];
// }
memcpy
(
erweima
,
barcode_Msg
,
34
);
erweima
[
34
]
=
0xFF
;
General_Number_Disp
(
erweima
,
3
,
90
);
if
(
writeflag
==
1
||
writeflag
==
3
)
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_dui12
);
}
else
if
(
saomafinish
==
2
)
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_cuo12
);
memcpy
(
erweima
,
barcode_Msg
,
34
);
erweima
[
34
]
=
0xFF
;
General_Number_Disp
(
erweima
,
3
,
90
);
if
(
writeflag
==
1
||
writeflag
==
3
)
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_dui12
);
}
else
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_cuo12
);
}
mimaread
[
34
]
=
0xFF
;
General_Number_Disp
(
mimaread
,
3
,
200
);
}
break
;
...
...
@@ -310,10 +316,8 @@ uint8_t yibiaoshuju[34];
{
General_Number_Disp
(
blename
,
3
,
165
);
}
// recvflag111 = 0;
// }
// POWER_CTRL_KL30 = 0u; //B+
// POWER_CTRL_KL15 = 0u; //KL15
// CAN_Msg_Tx_Enable = 1u;
...
...
@@ -325,10 +329,6 @@ uint8_t yibiaoshuju[34];
// // Function_Check_Ctrl(1); //Excel表格发报文。硬线信号
// //FUEL_UDS__Display(3);
// Buzzer_Warning();
// break;
// case 4:
...
...
YueJin_test_bench/source/Appliciation/Display_Info.c
View file @
3e74870b
...
...
@@ -3814,7 +3814,7 @@ void Display_Version_Info(uint32_t ON_OFF)
// TFT_LCD_Draw_Bmp(3, 160, ( uint8_t * )gImage_Alarm_12_WordX6_Y165); //24脚输出占空比
// TFT_LCD_Draw_Bmp(210, 160, ( uint8_t * )gImage_Alarm_13_ImageX222_Y166); //%
TFT_LCD_Draw_Bmp
(
3
,
290
,
(
uint8_t
*
)
gImage_gImage_checkVX6_Y165
);
//检测台版本号
uint8_t
mbuff
[
7
]
=
{
2
,
5
,
0
,
8
,
2
,
0
,
0xff
};
uint8_t
mbuff
[
7
]
=
{
2
,
5
,
0
,
8
,
2
,
8
,
0xff
};
General_Number_Disp
(
mbuff
,
160
,
290
);
}
...
...
YueJin_test_bench/source/Appliciation/Key.h
View file @
3e74870b
...
...
@@ -13,6 +13,7 @@ typedef enum
KEY_10
,
KEY_11
,
KEY_3
,
KEY_1
,
KEY_NUM_MAX
,
}
Key_Num_en_t
;
...
...
YueJin_test_bench/source/Appliciation/Key_user.c
View file @
3e74870b
...
...
@@ -11,10 +11,16 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent) //下一步
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
if
(
zhenduanflag
==
1
)
{
zhenduanflag
=
0
;
}
if
(
firstpowerflag
==
2
)
{
MENU_CHECK_STEP_ADD
(
);
}
zhenduansendStep
=
0
;
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
...
...
@@ -254,6 +260,33 @@ void Key_Operation_SW1(Key_Event_en_t enKeyEvent) //自动下电模式
}
}
void
Key_Operation_SW6
(
Key_Event_en_t
enKeyEvent
)
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
if
(
BlueTooth
==
0
)
{
BlueTooth
=
1
;
}
else
{
BlueTooth
=
0
;
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
}
else
if
(
enKeyEvent
==
KEY_EVENT_SUPER_LONG_PRESS
)
{
}
else
{
}
}
/*-------------------------------------------------*/
Key_Real_Status_en_t
Key_Real_sw5
(
void
)
{
...
...
@@ -353,6 +386,18 @@ Key_Real_Status_en_t Key_Real_sw10(void)
return
enKeyRealStatus
;
}
Key_Real_Status_en_t
Key_Real_sw6
(
void
)
{
Key_Real_Status_en_t
enKeyRealStatus
=
KEY_LINE_LOOSEN
;
if
(
SW9
==
0U
)
{
enKeyRealStatus
=
KEY_LINE_PRESS
;
}
return
enKeyRealStatus
;
}
void
Key_Operation_SW10
(
Key_Event_en_t
enKeyEvent
)
{
/*清零ODO*/
...
...
@@ -404,5 +449,5 @@ const Key_Attribute_st_t stKeyAttribute [ KEY_NUM_MAX ] = {
{
KEY_TYPE_LINE
,
Key_Real_sw1
,
Key_Operation_SW1
},
//SW1+
{
KEY_TYPE_LINE
,
Key_Real_sw10
,
Key_Operation_SW10
},
{
KEY_TYPE_LINE
,
Key_Real_sw3
,
Key_Operation_SW3
},
//SW1+
{
KEY_TYPE_LINE
,
Key_Real_sw6
,
Key_Operation_SW6
},
//SW1+
};
YueJin_test_bench/source/Appliciation/R485_Communication_Matrix.c
View file @
3e74870b
...
...
@@ -6,10 +6,6 @@ uint8_t barcode_Msg1[64];
uint8_t
name1
=
0
;
uint8_t
name2
=
0
;
void
bee
(
void
)
{
LINE_FUEL_RES03
=
LINE_FUEL_RES03
^
1
;
}
uint32_t
R485_Send_0xD0
(
void
)
{
memset
(
R485_IDD0h
.
Msg
,
0xFF
,
27
);
...
...
@@ -149,14 +145,17 @@ uint32_t R485_Send_0xD1(void)
case
9
:
R485_IDD1h
.
Sig
.
MainBatteryQuantity
=
0xB0
;
//电量
R485_IDD1h
.
Sig
.
BatteryChargingStatus
=
0x01
;
//充电枪
break
;
case
10
:
R485_IDD1h
.
Sig
.
MainBatteryQuantity
=
0xC6
;
//电量
R485_IDD1h
.
Sig
.
BatteryChargingStatus
=
0x01
;
//充电枪
break
;
case
11
:
R485_IDD1h
.
Sig
.
MainBatteryQuantity
=
0xC8
;
//电量
R485_IDD1h
.
Sig
.
BatteryChargingStatus
=
0x01
;
//充电枪
break
;
default:
...
...
@@ -483,6 +482,9 @@ uint32_t R485_Send_0x04(void)
case
3
:
length
=
37
;
break
;
case
4
:
length
=
3
;
break
;
case
5
:
break
;
case
6
:
...
...
@@ -517,19 +519,18 @@ uint32_t R485_Send_0x04(void)
memcpy
(
R485_zhenduan_Msg
+
3
,
barcode_Msg
,
34
);
break
;
case
4
:
// LINE_OUT_NEG_01 = 0;
// LINE_OUT_NEG_02 = 0;
// LINE_OUT_NEG_03 = 0;
// LINE_OUT_NEG_04 = 0;
R485_zhenduan_Msg
[
0
]
=
0x22
;
R485_zhenduan_Msg
[
1
]
=
0x50
;
R485_zhenduan_Msg
[
2
]
=
0x0
;
break
;
default:
break
;
}
RS485_TX_finish
=
1
;
if
(
zhenduansendStep
!
=
4
)
{
u32sendendflag
=
R485_Send
(
0x
47
,
R485_zhenduan_Msg
,
length
);
}
// if(zhenduansendStep
= 4)
//
{
u32sendendflag
=
R485_Send
(
0x
04
,
R485_zhenduan_Msg
,
length
);
//
}
RS485_send_time
=
0
;
RS485_TX_finish
=
1
;
...
...
@@ -1307,83 +1308,7 @@ uint32_t R485_Send_ble0x42(void)
}
uint32_t
R485_Send_0x47
(
void
)
{
uint8_t
length
;
uint32_t
u32sendendflag
=
0
;
if
(
RS485_TX_finish
==
0
)
{
switch
(
zhenduansendStep
)
{
case
0
:
length
=
2
;
break
;
case
1
:
length
=
2
;
break
;
case
2
:
length
=
6
;
break
;
case
3
:
length
=
37
;
break
;
case
5
:
break
;
case
6
:
length
=
3
;
break
;
default:
break
;
}
switch
(
zhenduansendStep
)
{
case
0
:
// R485_zhenduan_Msg[0] = 0x2;
R485_zhenduan_Msg
[
0
]
=
0x10
;
R485_zhenduan_Msg
[
1
]
=
0x03
;
break
;
case
1
:
// R485_zhenduan_Msg[0] = 0x2;
R485_zhenduan_Msg
[
0
]
=
0x27
;
R485_zhenduan_Msg
[
1
]
=
0x1
;
break
;
case
2
:
// R485_zhenduan_Msg[0] = 0x6;
R485_zhenduan_Msg
[
0
]
=
0x27
;
R485_zhenduan_Msg
[
1
]
=
0x2
;
R485_zhenduan_Msg
[
2
]
=
key_array
[
0
];
R485_zhenduan_Msg
[
3
]
=
key_array
[
1
];
R485_zhenduan_Msg
[
4
]
=
key_array
[
2
];
R485_zhenduan_Msg
[
5
]
=
key_array
[
3
];
break
;
case
3
:
R485_zhenduan_Msg
[
0
]
=
0x2E
;
R485_zhenduan_Msg
[
1
]
=
0x50
;
R485_zhenduan_Msg
[
2
]
=
0x0
;
memcpy
(
R485_zhenduan_Msg
+
3
,
barcode_Msg
,
34
);
break
;
case
4
:
LINE_OUT_NEG_01
=
0
;
LINE_OUT_NEG_02
=
0
;
LINE_OUT_NEG_03
=
0
;
LINE_OUT_NEG_04
=
0
;
break
;
default:
break
;
}
RS485_TX_finish
=
1
;
if
(
zhenduansendStep
!=
4
)
{
u32sendendflag
=
R485_Send
(
0x47
,
R485_zhenduan_Msg
,
length
);
}
RS485_send_time
=
0
;
RS485_TX_finish
=
1
;
}
RS485_TX_finish
=
1
;
return
u32sendendflag
;
}
uint8_t
R485_0x80_msg
[
64
];
uint32_t
R485_Send_0x80
(
void
)
...
...
YueJin_test_bench/source/Appliciation/R485_Communication_Matrix.h
View file @
3e74870b
...
...
@@ -1875,7 +1875,6 @@ extern uint32_t R485_Send_0xD3(void);
extern
uint32_t
R485_Send_0xA4
(
void
);
// extern uint32_t R485_Send_0x80(void);
extern
uint32_t
R485_Send_0x04
(
void
);
extern
void
bee
(
void
);
extern
uint8_t
barcode_Msg
[
64
];
extern
uint8_t
barcode_Msg1
[
64
];
extern
uint8_t
name1
;
...
...
YueJin_test_bench/source/Appliciation/Task.c
View file @
3e74870b
...
...
@@ -54,7 +54,6 @@ void Sys_Run_Mode_Pseudo_Real_Time_Tasks(void)
Fre_In_Service
(
FRE_VEHICLE
);
// MENU_CHECK_STEP = 11;
//Fre_In_Service(FRE_ENGINE);
// bee();
}
/*============================================================================*/
...
...
@@ -190,8 +189,11 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
if
(
zhenduanflag
==
0
)
{
RS485_User_Tx_Data
();
// IGONTime = 0;
// R485_Send_0x04();
}
else
if
(
zhenduanflag
==
1
)
{
R485_Send_0x04
();
R485_Send_0x80
();
}
}
}
...
...
YueJin_test_bench/source/Appliciation/api_RS485.c
View file @
3e74870b
...
...
@@ -389,7 +389,8 @@ uint8_t sendmsgAll[8];
uint32_t
sendnum
=
1
;
uint8_t
getbanbenhaoflag
=
0
;
uint32_t
send80time
=
0
;
uint8_t
BlueTooth
=
0
;
uint8_t
dianliangflag
=
0
;
uint8_t
RS485_User_Tx_Data
(
void
)
{
uint32_t
sendfinishflag
=
0
;
...
...
@@ -414,7 +415,7 @@ uint8_t RS485_User_Tx_Data(void)
// RS485_TxControl.sendIndex ++;
// }
break
;
//
break;
case
RS485_Tx_IDA4_Idx
:
if
((
MENU_CHECK_STEP
==
0
)
&&
(
clearOdoFlag
==
0
))
...
...
@@ -459,15 +460,17 @@ uint8_t RS485_User_Tx_Data(void)
case
RS485_Tx_IDD1_Idx
:
if
((
MENU_CHECK_STEP
!=
16
)
&&
(
clearOdoFlag
==
0
))
{
sendfinishflag
=
R485_Send_0xD1
();
RS485_TX_finish
=
1
;
if
(
sendfinishflag
==
0
)
if
(
dianliangflag
==
0
)
{
if
(
RS485_TX_finish
==
1
)
{
RS485_send_time
=
0
;
RS485_TxControl
.
sendIndex
++
;
}
sendfinishflag
=
R485_Send_0xD1
();
dianliangflag
++
;
}
else
{
RS485_send_time
=
0
;
RS485_TxControl
.
sendIndex
++
;
RS485_TX_finish
=
1
;
dianliangflag
=
0
;
}
}
else
...
...
@@ -525,48 +528,27 @@ uint8_t RS485_User_Tx_Data(void)
{
if
(
MENU_CHECK_STEP
==
16
)
{
RS485_TxControl
.
Openble
[
0
]
=
0x59
;
RS485_TxControl
.
Openble
[
1
]
=
0x44
;
RS485_TxControl
.
Openble
[
2
]
=
0xA
;
RS485_TxControl
.
Openble
[
3
]
=
0x8A
;
RS485_TxControl
.
Openble
[
4
]
=
0xA
;
RS485_TxControl
.
Openble
[
5
]
=
0xA
;
RS485_TxControl
.
Openble
[
6
]
=
name2
;
RS485_TxControl
.
Openble
[
7
]
=
name1
;
RS485_TxControl
.
Openble
[
8
]
=
1
;
RS485_TxControl
.
Openble
[
9
]
=
btmac
[
0
];
RS485_TxControl
.
Openble
[
10
]
=
btmac
[
1
];
RS485_TxControl
.
Openble
[
11
]
=
btmac
[
2
];
RS485_TxControl
.
Openble
[
12
]
=
btmac
[
3
];
RS485_TxControl
.
Openble
[
13
]
=
btmac
[
4
];
RS485_TxControl
.
Openble
[
14
]
=
btmac
[
5
];
RS485_TxControl
.
Openble
[
15
]
=
0x4B
;
RS485_TxControl
.
Openble
[
16
]
=
0x4A
;
UART_Ch2_Send_Multiple_Byte
(
RS485_TxControl
.
Openble
,
sizeof
(
RS485_TxControl
.
Openble
));
}
else
{
RS485_TxControl
.
Openble
[
0
]
=
0x59
;
RS485_TxControl
.
Openble
[
1
]
=
0x44
;
RS485_TxControl
.
Openble
[
2
]
=
0xA
;
RS485_TxControl
.
Openble
[
3
]
=
0x8A
;
RS485_TxControl
.
Openble
[
4
]
=
0xA
;
RS485_TxControl
.
Openble
[
5
]
=
0xA
;
RS485_TxControl
.
Openble
[
6
]
=
name2
;
RS485_TxControl
.
Openble
[
7
]
=
name1
;
RS485_TxControl
.
Openble
[
8
]
=
0
;
RS485_TxControl
.
Openble
[
9
]
=
btmac
[
0
];
RS485_TxControl
.
Openble
[
10
]
=
btmac
[
1
];
RS485_TxControl
.
Openble
[
11
]
=
btmac
[
2
];
RS485_TxControl
.
Openble
[
12
]
=
btmac
[
3
];
RS485_TxControl
.
Openble
[
13
]
=
btmac
[
4
];
RS485_TxControl
.
Openble
[
14
]
=
btmac
[
5
];
RS485_TxControl
.
Openble
[
15
]
=
0x4B
;
RS485_TxControl
.
Openble
[
16
]
=
0x4A
;
UART_Ch2_Send_Multiple_Byte
(
RS485_TxControl
.
Openble
,
sizeof
(
RS485_TxControl
.
Openble
));
BlueTooth
=
1
;
}
RS485_TxControl
.
Openble
[
0
]
=
0x59
;
RS485_TxControl
.
Openble
[
1
]
=
0x44
;
RS485_TxControl
.
Openble
[
2
]
=
0xA
;
RS485_TxControl
.
Openble
[
3
]
=
0x8A
;
RS485_TxControl
.
Openble
[
4
]
=
0xA
;
RS485_TxControl
.
Openble
[
5
]
=
0xA
;
RS485_TxControl
.
Openble
[
6
]
=
name2
;
RS485_TxControl
.
Openble
[
7
]
=
name1
;
RS485_TxControl
.
Openble
[
8
]
=
BlueTooth
;
RS485_TxControl
.
Openble
[
9
]
=
btmac
[
0
];
RS485_TxControl
.
Openble
[
10
]
=
btmac
[
1
];
RS485_TxControl
.
Openble
[
11
]
=
btmac
[
2
];
RS485_TxControl
.
Openble
[
12
]
=
btmac
[
3
];
RS485_TxControl
.
Openble
[
13
]
=
btmac
[
4
];
RS485_TxControl
.
Openble
[
14
]
=
btmac
[
5
];
RS485_TxControl
.
Openble
[
15
]
=
0x4B
;
RS485_TxControl
.
Openble
[
16
]
=
0x4A
;
UART_Ch2_Send_Multiple_Byte
(
RS485_TxControl
.
Openble
,
sizeof
(
RS485_TxControl
.
Openble
));
sendfinishflag
=
R485_Send_0x80
();
if
(
sendfinishflag
==
0
)
{
...
...
@@ -604,6 +586,11 @@ void backsend(void)
{
backtime
=
1
;
}
if
(
zhenduanflag
==
1
)
{
backtime
=
10
;
}
if
(
RS485_send_time
>=
backtime
)
{
RS485_send_time
=
0
;
...
...
YueJin_test_bench/source/Appliciation/api_RS485.h
View file @
3e74870b
...
...
@@ -67,6 +67,8 @@ typedef struct
}
RS485ValidDataPacket_st_t
;
extern
uint32_t
RS485_send_time
;
extern
uint8_t
RS485_TX_finish
;
extern
uint8_t
BlueTooth
;
extern
uint8_t
dianliangflag
;
// extern uint32_t RS485_send_num;
extern
uint32_t
sendnum
;
extern
uint8_t
sendmsgAll
[
8
];
...
...
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