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
dc1aa1bb
Commit
dc1aa1bb
authored
Feb 24, 2025
by
梁百峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:上电扫码,如果不需要扫码初始化将firstpowerflag = 2
parent
54f657fd
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
233 additions
and
137 deletions
+233
-137
Barcode_Scanner.c
YueJin_test_bench/source/Appliciation/Barcode_Scanner.c
+5
-0
Barcode_Scanner.h
YueJin_test_bench/source/Appliciation/Barcode_Scanner.h
+1
-0
Key_user.c
YueJin_test_bench/source/Appliciation/Key_user.c
+100
-71
Task.c
YueJin_test_bench/source/Appliciation/Task.c
+121
-66
init.c
YueJin_test_bench/source/System/init.c
+6
-0
No files found.
YueJin_test_bench/source/Appliciation/Barcode_Scanner.c
View file @
dc1aa1bb
...
...
@@ -47,6 +47,7 @@ uint8_t powerstdio = 0;
uint8_t
get_num_buf
[
34
];
uint8_t
comparestart
;
uint8_t
blename
[
5
];
uint8_t
firstpowerflag
=
0
;
void
get_key
(
void
)
{
key_array
[
0
]
=
seed_value
[
0
]
|
seed_value
[
3
];
...
...
@@ -410,6 +411,10 @@ void UART_Put1(uint32_t Value)
// RS485_TX_finish = 0;
// LINE_OUT_NEG_09 = 1;
// RS485_TX_finish = 0;
if
(
firstpowerflag
!=
2
)
{
firstpowerflag
=
1
;
}
return
;
}
void
Recv_Byte
(
void
)
...
...
YueJin_test_bench/source/Appliciation/Barcode_Scanner.h
View file @
dc1aa1bb
...
...
@@ -33,4 +33,5 @@ extern uint8_t connectbleFlag;
extern
uint8_t
get_num_buf
[
34
];
extern
uint8_t
blename
[
5
];
extern
uint8_t
recvflag111
;
extern
uint8_t
firstpowerflag
;
#endif
\ No newline at end of file
YueJin_test_bench/source/Appliciation/Key_user.c
View file @
dc1aa1bb
...
...
@@ -9,22 +9,28 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent)
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
if
(
(
LED_Waring
==
1
)
||
(
UDS_Warning_Voltage
==
1
))
{
;
}
else
// if ( (LED_Waring == 1) || (UDS_Warning_Voltage ==1))
// {
// ;
// }
// else
// {
// Display_Add( );
// Display_TFT_Clear( );
// }
if
(
firstpowerflag
==
2
)
{
Display_Add
(
);
Display_TFT_Clear
(
);
MENU_CHECK_STEP_ADD
(
);
}
MENU_CHECK_STEP_ADD
(
);
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
if
(
firstpowerflag
==
2
)
{
if
(
AutoFlag
==
1
)
{
AutoFlag
=
0
;
...
...
@@ -34,6 +40,7 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent)
AutoFlag
=
1
;
}
}
}
// else if ( enKeyEvent == KEY_EVENT_SUPER_LONG_PRESS )
// {
// if ( (LED_Waring == 1) || (UDS_Warning_Voltage ==1))
...
...
@@ -65,8 +72,11 @@ void Key_Operation_SW4(Key_Event_en_t enKeyEvent)
// Display_Sub( );
// Display_TFT_Clear( );
// }
if
(
firstpowerflag
==
2
)
{
MENU_CHECK_STEP_SUB
();
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
...
...
@@ -94,6 +104,8 @@ void Key_Operation_SW7(Key_Event_en_t enKeyEvent)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
if
(
firstpowerflag
==
2
)
{
if
(
zhenduanflag
!=
2
&&
zhenduanflag
!=
3
)
{
zhenduanflag
=
2
;
...
...
@@ -103,6 +115,8 @@ void Key_Operation_SW7(Key_Event_en_t enKeyEvent)
zhenduanflag
=
0
;
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
}
...
...
@@ -116,6 +130,8 @@ void Key_Operation_SW7(Key_Event_en_t enKeyEvent)
void
Key_Operation_SW8
(
Key_Event_en_t
enKeyEvent
)
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
if
(
firstpowerflag
==
2
)
{
if
(
zhenduanflag
!=
1
)
{
...
...
@@ -133,6 +149,7 @@ void Key_Operation_SW8(Key_Event_en_t enKeyEvent)
}
RS485_TX_finish
=
0
;
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
...
...
@@ -148,6 +165,9 @@ void Key_Operation_SW8(Key_Event_en_t enKeyEvent)
void
Key_Operation_SW2
(
Key_Event_en_t
enKeyEvent
)
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
if
(
firstpowerflag
==
2
)
{
if
(
LINE_OUT_NEG_01
==
1U
)
{
...
...
@@ -159,7 +179,7 @@ void Key_Operation_SW2(Key_Event_en_t enKeyEvent)
LINE_OUT_NEG_01
=
1U
;
Auto_ONOFF
==
0
;
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
...
...
@@ -179,6 +199,8 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent)
// {
// MENU_CHECK_STEP_SUB( );
// }
if
(
firstpowerflag
==
2
)
{
if
(
clearOdoFlag
==
0
)
{
clearOdoFlag
=
1
;
...
...
@@ -188,6 +210,7 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent)
clearOdoFlag
=
0
;
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
}
...
...
@@ -206,6 +229,8 @@ void Key_Operation_SW1(Key_Event_en_t enKeyEvent)
{
/*清零ODO*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
if
(
firstpowerflag
==
2
)
{
if
(
Auto_ONOFF
!=
0
)
{
...
...
@@ -215,6 +240,7 @@ void Key_Operation_SW1(Key_Event_en_t enKeyEvent)
{
Auto_ONOFF
=
1
;
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
...
...
@@ -337,6 +363,9 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
if
(
firstpowerflag
==
2
)
{
Display_TFT_Clear
();
if
(
connectbleFlag
==
0
)
{
connectbleFlag
=
1
;
...
...
@@ -345,7 +374,6 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent)
}
else
{
Display_TFT_Clear
();
name1
=
(
devicename
)
&
0xFF
;
name2
=
(
devicename
>>
8
)
&
0xFF
;
startONfalg
=
0
;
...
...
@@ -355,6 +383,7 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent)
startIGONtime
=
0
;
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
}
...
...
YueJin_test_bench/source/Appliciation/Task.c
View file @
dc1aa1bb
...
...
@@ -36,6 +36,7 @@ uint32_t send0x42time = 0;
uint32_t
bleOFFtoONtime
=
0
;
uint8_t
startONfalg
=
0
;
uint32_t
startIGONtime
=
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
)
...
...
@@ -106,7 +107,8 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
// UART_Ch0_Send_Multiple_Byte(testdata,3);
// RS485_User_Tx_Data();
if
(
firstpowerflag
==
2
)
{
if
(
clearOdoFlag
==
0
)
{
backsend
();
...
...
@@ -222,6 +224,8 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
queren
=
1
;
}
}
}
}
...
...
@@ -341,6 +345,8 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
{
RS485_send_time
++
;
}
if
(
firstpowerflag
==
2
)
{
if
(
AutoFlag
==
1
)
{
if
(
AutoTime
<=
200
)
...
...
@@ -443,7 +449,56 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
recvflag111
=
0
;
}
}
if
(
firstpowerflag
==
1
)
{
zhenduanflag
=
2
;
Total_Check
();
firstpowerflag
=
2
;
Display_TFT_Clear
();
if
(
compareresult
==
1
&&
comparestart
==
0
)
{
// Total_Check();
if
(
compareresult
==
1
)
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_cuo1
);
// comparestart = 2;
}
else
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_dui1
);
// comparestart = 2;
}
Total_Check
();
firstpowerflag
=
3
;
// zhendlag = 5;
}
}
else
{
if
(
compareresult
==
1
)
{
Total_Check
();
firstpowerflag
=
3
;
zhenduanflag
=
2
;
if
(
compareresult
==
1
)
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_cuo1
);
// comparestart = 2;
}
else
{
TFT_LCD_Draw_Bmp
(
200
,
90
+
40
,
(
uint8_t
*
)
gImage_dui1
);
// comparestart = 2;
}
// Total_Check();
// zhenduanflag = 5;
}
// zhenduanflag = 2;
}
//u16LJSText = TFT_LCD_REQ_FIFO_MAX_DEPTH;
}
/*=================================================================*/
...
...
YueJin_test_bench/source/System/init.c
View file @
dc1aa1bb
...
...
@@ -104,6 +104,12 @@ void Sys_Startup_Init(void)
loc_config
.
pfnUARTErrHandleCallBack
=
0
;
loc_config
.
pfnUARTReadMsgCallBack
=
UART_Put1
;
UART_Init
(
UART_RLIN31
,
&
loc_config
);
LINE_OUT_NEG_01
=
1
;
LINE_OUT_NEG_02
=
1
;
LINE_OUT_NEG_03
=
1
;
LINE_OUT_NEG_04
=
1
;
Display_TFT_Clear
();
GUI_Display_Version_Code_Service
(
25
,
20
,
"Please Scan The Code "
,
Letter_Num_11
,
PCodeText_Space_size
);
}
/***********************************************************************
...
...
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