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
61bd4142
Commit
61bd4142
authored
Feb 03, 2026
by
何锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:265检测与光感
parent
062173ea
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
166 additions
and
117 deletions
+166
-117
Barcode_Scanner.c
YueJin_test_bench/source/Appliciation/Barcode_Scanner.c
+7
-18
Barcode_Scanner.h
YueJin_test_bench/source/Appliciation/Barcode_Scanner.h
+10
-1
Check_Ctrl.c
YueJin_test_bench/source/Appliciation/Check_Ctrl.c
+8
-8
Display_Info.c
YueJin_test_bench/source/Appliciation/Display_Info.c
+111
-3
R485_Communication_Matrix.c
...est_bench/source/Appliciation/R485_Communication_Matrix.c
+8
-3
Task.c
YueJin_test_bench/source/Appliciation/Task.c
+1
-63
api_RS485.c
YueJin_test_bench/source/Appliciation/api_RS485.c
+16
-17
api_RS485.h
YueJin_test_bench/source/Appliciation/api_RS485.h
+1
-0
init.c
YueJin_test_bench/source/System/init.c
+4
-4
No files found.
YueJin_test_bench/source/Appliciation/Barcode_Scanner.c
View file @
61bd4142
...
...
@@ -47,7 +47,6 @@ uint8_t line_stdio = 2;
uint8_t
powerstdio
=
0
;
uint8_t
get_num_buf
[
34
];
uint8_t
mimaread
[
35
];
uint8_t
comparestart
;
uint8_t
blename
[
5
];
uint8_t
btmac
[
6
];
uint8_t
firstpowerflag
=
0
;
...
...
@@ -438,12 +437,19 @@ void datacheck(void)
}
}
uint8_t
cmpresult
=
3
;
uint8_t
Vehicle_Type
;
uint8_t
entertime
=
0
;
void
BarCodeDataGet
(
void
)
{
if
((
mDataBufPtr1
[
0
]
==
0x59
)
&&
(
mDataBufPtr1
[
1
]
==
0x59
)
&&
(
mDataBufPtr1
[
39
]
!=
0x0
))
{
memcpy
(
barcode_Msg
,
&
mDataBufPtr1
[
6
],
34
);
memcpy
(
barcode_Msg1
,
&
mDataBufPtr1
[
6
],
34
);
if
((
mDataBufPtr1
[
12
]
==
0x41
)
&&
(
mDataBufPtr1
[
13
]
==
0x32
)
&&
(
mDataBufPtr1
[
14
]
==
0x36
)
&&
(
mDataBufPtr1
[
15
]
==
0x35
))
{
Vehicle_Type
=
TFT_A265
;
}
}
else
{
...
...
@@ -455,23 +461,6 @@ void BarCodeDataGet(void)
uint8_t
GetDataCompare
(
void
)
{
for
(
int
i
=
0
;
i
<
34
;
i
++
)
{
if
(
get_num_buf
[
i
]
==
barcode_Msg1
[
i
]
)
{
cmpresult
=
0
;
// u8compareresult = 0;
}
else
{
cmpresult
=
1
;
return
cmpresult
;
// u8compareresult = 1;
}
}
return
cmpresult
;
}
void
UART_Put
(
uint32_t
Value
)
{
...
...
YueJin_test_bench/source/Appliciation/Barcode_Scanner.h
View file @
61bd4142
...
...
@@ -4,6 +4,14 @@
#include "TYW_stdint.h"
#include "api_RS485.h"
#include "R485_Communication_Matrix.h"
typedef
enum
{
TFT_G389
=
0
,
TFT_A265
,
}
VehicleType
;
void
UART_Put
(
uint32_t
Value
);
void
UART_Put1
(
uint32_t
Value
);
void
UART_Put2
(
uint32_t
Value
);
...
...
@@ -32,7 +40,6 @@ extern uint8_t line_stdio;
extern
uint8_t
checknumwrong
;
extern
uint8_t
powerstdio
;
extern
uint8_t
Auto_ONOFF
;
extern
uint8_t
comparestart
;
extern
uint8_t
connectbleFlag
;
extern
uint8_t
get_num_buf
[
34
];
extern
uint8_t
blename
[
5
];
...
...
@@ -43,4 +50,6 @@ extern uint8_t btmac[6];
extern
uint8_t
writeflag
;
extern
uint8_t
saomafinish
;
extern
uint8_t
mimaread
[
35
];
extern
uint8_t
Vehicle_Type
;
extern
uint8_t
entertime
;
#endif
\ No newline at end of file
YueJin_test_bench/source/Appliciation/Check_Ctrl.c
View file @
61bd4142
...
...
@@ -73,16 +73,17 @@ void MENU_CHECK_STEP_ADD(void)
{
if
(
jiaoyan
==
1
)
{
MENU_CHECK_STEP
++
;
if
(
MENU_CHECK_STEP
>
14
)
if
(
guangganflag
==
3
)
//光感锁
{
MENU_CHECK_STEP
++
;
}
if
(
MENU_CHECK_STEP
>
9
)
//循环
{
MENU_CHECK_STEP
=
0
;
guangganflag
=
0
;
}
// if((guangganflag == 2 || guangganflag == 1 ) && guangganflag != 3)
// {
// MENU_CHECK_STEP = 3;
// }
if
(
CurrentWrong
==
1
)
{
MENU_CHECK_STEP
=
1
;
...
...
@@ -363,7 +364,6 @@ uint8_t yibiaoshuju[34];
// yibiaoshuju[34] = 0xFF;
// General_Number_Disp(yibiaoshuju, 3, 165);
// zhenduanflag = 3;
// comparestart = 1;
break
;
case
2
:
// POWER_CTRL_KL30 = 0u; //B+
...
...
YueJin_test_bench/source/Appliciation/Display_Info.c
View file @
61bd4142
This diff is collapsed.
Click to expand it.
YueJin_test_bench/source/Appliciation/R485_Communication_Matrix.c
View file @
61bd4142
...
...
@@ -3,6 +3,8 @@
#include "string.h"
#include "Key.h"
#include "Display_Info.h"
#include "Barcode_Scanner.h"
uint8_t
barcode_Msg
[
64
];
uint8_t
barcode_Msg1
[
64
];
uint8_t
name1
=
0
;
...
...
@@ -698,12 +700,15 @@ uint32_t R485_Send_0xA4(void)
uint32_t
R485_Send_0xC4
(
void
)
//菜单设置收发
{
memset
(
R485_ID
C4h
.
Msg
,
0xFF
,
1
);
memset
(
R485_ID
B2h
.
Msg
,
0xFF
,
RS485_RX_ID0XB2_DATA_LEN
);
R485_IDC4h
.
Sig
.
Invalid_characterssecond
=
0x01
;
if
(
Vehicle_Type
==
TFT_A265
)
{
R485_IDB2h
.
Sig
.
VehicleType
=
0x00
;
}
uint32_t
u32sendendflag
=
0
;
u32sendendflag
=
R485_Send
(
0x
C4
,
R485_IDC4h
.
Msg
,
sizeof
(
R485_IDC4
h
.
Msg
));
u32sendendflag
=
R485_Send
(
0x
B2
,
R485_IDB2h
.
Msg
,
sizeof
(
R485_IDB2
h
.
Msg
));
return
u32sendendflag
;
}
...
...
YueJin_test_bench/source/Appliciation/Task.c
View file @
61bd4142
...
...
@@ -25,7 +25,6 @@
------------------------------------------------------------------------------*/
uint8_t
AutoFlag
=
0
;
uint8_t
compareresult
;
const
unsigned
char
gImage_cuo1
[]
=
{
24
,
24
,
0X00
,
0X00
,
0X00
,
0X00
,
0X30
,
0X70
,
0XE0
,
0XC0
,
0X80
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X80
,
0XC0
,
0X70
,
0X30
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X01
,
0X83
,
0XC7
,
0X66
,
0X38
,
0X38
,
0X7C
,
0XE6
,
0XC3
,
0X81
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X0C
,
0X0C
,
0X06
,
0X03
,
0X01
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X01
,
0X03
,
0X07
,
0X0E
,
0X0C
,
0X00
,
0X00
,
0X00
,
0X00
,};
const
unsigned
char
gImage_dui1
[]
=
{
24
,
24
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X80
,
0XC0
,
0XE0
,
0X40
,
0X00
,
0X00
,
0X00
,
0X00
,
0X08
,
0X18
,
0X30
,
0X70
,
0XC0
,
0X80
,
0X00
,
0X00
,
0X80
,
0XC0
,
0XE0
,
0X70
,
0X38
,
0X1C
,
0X0E
,
0X07
,
0X03
,
0X01
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X01
,
0X03
,
0X07
,
0X03
,
0X01
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,
0X00
,};
void
Sys_Run_Mode_Pseudo_Real_Time_Tasks
(
void
)
...
...
@@ -212,38 +211,7 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
}
else
{
if
(
comparestart
==
1
)
{
compareresult
=
GetDataCompare
();
if
(
compareresult
==
1
)
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_cuo1
);
}
else
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_dui1
);
}
comparestart
=
0
;
}
else
if
(
comparestart
==
0
)
{
Total_Check
(
);
if
(
zhenduanflag
==
3
)
{
if
(
compareresult
==
1
)
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_cuo1
);
}
else
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_dui1
);
}
}
}
else
{
Total_Check
();
}
Total_Check
(
);
flashtime
=
0
;
}
}
...
...
@@ -254,37 +222,7 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
Total_Check
();
firstpowerflag
=
2
;
Display_TFT_Clear
();
if
(
compareresult
==
1
&&
comparestart
==
0
)
{
if
(
compareresult
==
1
)
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_cuo1
);
}
else
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_dui1
);
}
Total_Check
();
firstpowerflag
=
3
;
}
}
else
{
if
(
compareresult
==
1
)
{
Total_Check
();
firstpowerflag
=
3
;
zhenduanflag
=
Data_Mode_Read
;
if
(
compareresult
==
1
)
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_cuo1
);
}
else
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_dui1
);
}
}
}
}
/*=================================================================*/
...
...
YueJin_test_bench/source/Appliciation/api_RS485.c
View file @
61bd4142
...
...
@@ -524,23 +524,22 @@ uint8_t RS485_User_Tx_Data(void)
}
break
;
// case RS485_Tx_IDC4_Idx:
// if(MENU_CHECK_STEP == 0)
// {
// sendfinishflag = R485_Send_0xC4();
// RS485_TX_finish = 1;
// if(sendfinishflag == 0)
// {
// RS485_send_time = 0;
// RS485_TxControl.sendIndex ++;
// }
// }
// else
// {
// RS485_TxControl.sendIndex ++;
// }
// break;
case
RS485_Tx_IDB2_Idx
:
if
(
MENU_CHECK_STEP
==
0
)
{
sendfinishflag
=
R485_Send_0xC4
();
RS485_TX_finish
=
1
;
if
(
sendfinishflag
==
0
)
{
RS485_send_time
=
0
;
RS485_TxControl
.
sendIndex
++
;
}
}
else
{
RS485_TxControl
.
sendIndex
++
;
}
break
;
case
RS485_Tx_IDD0_Idx
:
sendfinishflag
=
R485_Send_0xD0
();
...
...
YueJin_test_bench/source/Appliciation/api_RS485.h
View file @
61bd4142
...
...
@@ -26,6 +26,7 @@ typedef enum
// RS485_Tx_ID04_Idx = 0,
RS485_Tx_ID80_Idx
=
0
,
RS485_Tx_IDA4_Idx
,
RS485_Tx_IDB2_Idx
,
RS485_Tx_IDD0_Idx
,
RS485_Tx_IDD1_Idx
,
RS485_Tx_IDD2_Idx
,
...
...
YueJin_test_bench/source/System/init.c
View file @
61bd4142
...
...
@@ -126,12 +126,12 @@ void Sys_Startup_Init(void)
EN_5V_CUT_ENABLE
=
1
;
//
Display_TFT_Clear();
//
GUI_Display_Version_Code_Service(25, 20, "Please Scan The Code ", Letter_Num_11, PCodeText_Space_size);
Display_TFT_Clear
();
GUI_Display_Version_Code_Service
(
25
,
20
,
"Please Scan The Code "
,
Letter_Num_11
,
PCodeText_Space_size
);
/*上电扫码校验功能如果需要扫码校验注释掉firstpowerflag = 2,saomafinish = 3;打开上面两行的注释即可*/
firstpowerflag
=
2
;
saomafinish
=
4
;
//
firstpowerflag = 2;
//
saomafinish = 4;
}
/***********************************************************************
...
...
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