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
fb7e1c2b
Commit
fb7e1c2b
authored
Dec 09, 2025
by
何锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加进入OTA界面
parent
8d358d96
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
177 additions
and
37 deletions
+177
-37
Check_Ctrl.c
YueJin_test_bench/source/Appliciation/Check_Ctrl.c
+84
-9
Display_Info.c
YueJin_test_bench/source/Appliciation/Display_Info.c
+26
-16
Display_Info.h
YueJin_test_bench/source/Appliciation/Display_Info.h
+2
-0
Key.c
YueJin_test_bench/source/Appliciation/Key.c
+2
-2
Key.h
YueJin_test_bench/source/Appliciation/Key.h
+1
-0
Key_user.c
YueJin_test_bench/source/Appliciation/Key_user.c
+45
-7
Task.c
YueJin_test_bench/source/Appliciation/Task.c
+16
-3
Task.h
YueJin_test_bench/source/Appliciation/Task.h
+1
-0
No files found.
YueJin_test_bench/source/Appliciation/Check_Ctrl.c
View file @
fb7e1c2b
...
...
@@ -71,8 +71,8 @@ void Function_Check_Ctrl(uint32_t cmd);
void
MENU_CHECK_STEP_ADD
(
void
)
{
if
(
jiaoyan
==
1
)
{
//
if(jiaoyan == 1)
//
{
MENU_CHECK_STEP
++
;
if
(
MENU_CHECK_STEP
>
14
)
...
...
@@ -87,7 +87,7 @@ void MENU_CHECK_STEP_ADD(void)
{
MENU_CHECK_STEP
=
1
;
}
}
//
}
}
void
MENU_CHECK_STEP_SUB
(
void
)
...
...
@@ -439,14 +439,89 @@ uint8_t yibiaoshuju[34];
// Buzzer_Warning();
break
;
// case 4:
// break;
case
4
:
//AP模式
if
(
Auto_ONOFF
==
0
)
{
LINE_OUT_NEG_01
=
1
;
LINE_OUT_NEG_04
=
1
;
LINE_OUT_NEG_02
=
1
;
LINE_OUT_NEG_03
=
1
;
}
RightturnSignal
=
0
;
LeftturnSignal
=
1
;
Bluetoothlight
=
0
;
Positionlight
=
1
;
highbeam
=
0
;
Lowbeam
=
0
;
GUI_Display_Version_Code_Service
(
15
,
120
,
"OTA "
,
Letter_Num_11
,
PCodeText_Space_size
);
GUI_Display_Version_Code_Service
(
15
,
150
,
"Name is "
,
Letter_Num_11
,
PCodeText_Space_size
);
blnamedisplay
[
0
]
=
name2
/
16
;
blnamedisplay
[
1
]
=
name2
%
16
;
blnamedisplay
[
2
]
=
name1
/
16
;
blnamedisplay
[
3
]
=
name1
%
16
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
if
(
blnamedisplay
[
i
]
>=
10
)
{
blnamedisplay
[
i
]
+=
55
;
}
}
blenamedisplay
[
0
]
=
blnamedisplay
[
0
];
blenamedisplay
[
1
]
=
blnamedisplay
[
1
];
blenamedisplay
[
2
]
=
blnamedisplay
[
2
];
blenamedisplay
[
3
]
=
blnamedisplay
[
3
];
blenamedisplay
[
4
]
=
0xFF
;
if
(
blnamedisplay
[
0
]
+
blnamedisplay
[
1
]
+
blnamedisplay
[
2
]
+
blnamedisplay
[
3
]
!=
0
)
{
General_Number_Disp
(
blenamedisplay
,
90
,
154
);
}
break
;
case
5
:
//P2P模式
if
(
Auto_ONOFF
==
0
)
{
LINE_OUT_NEG_01
=
1
;
LINE_OUT_NEG_04
=
1
;
LINE_OUT_NEG_02
=
1
;
LINE_OUT_NEG_03
=
1
;
}
RightturnSignal
=
1
;
LeftturnSignal
=
0
;
Bluetoothlight
=
0
;
Positionlight
=
1
;
highbeam
=
0
;
Lowbeam
=
0
;
GUI_Display_Version_Code_Service
(
15
,
120
,
"OTA "
,
Letter_Num_11
,
PCodeText_Space_size
);
GUI_Display_Version_Code_Service
(
15
,
150
,
"Name is "
,
Letter_Num_11
,
PCodeText_Space_size
);
blnamedisplay
[
0
]
=
name2
/
16
;
blnamedisplay
[
1
]
=
name2
%
16
;
blnamedisplay
[
2
]
=
name1
/
16
;
blnamedisplay
[
3
]
=
name1
%
16
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
if
(
blnamedisplay
[
i
]
>=
10
)
{
blnamedisplay
[
i
]
+=
55
;
}
}
blenamedisplay
[
0
]
=
blnamedisplay
[
0
];
blenamedisplay
[
1
]
=
blnamedisplay
[
1
];
blenamedisplay
[
2
]
=
blnamedisplay
[
2
];
blenamedisplay
[
3
]
=
blnamedisplay
[
3
];
blenamedisplay
[
4
]
=
0xFF
;
if
(
blnamedisplay
[
0
]
+
blnamedisplay
[
1
]
+
blnamedisplay
[
2
]
+
blnamedisplay
[
3
]
!=
0
)
{
General_Number_Disp
(
blenamedisplay
,
90
,
154
);
}
break
;
default:
// POWER_CTRL_KL30 = 0u;
...
...
YueJin_test_bench/source/Appliciation/Display_Info.c
View file @
fb7e1c2b
...
...
@@ -3884,7 +3884,7 @@ void Display_TFT_Clear(void)
TFT_LCD_Draw_Box(0, 0, 239, 319, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR);
}
void Display_Add(void)
void Display_Add(
void)
{
Display_Menu_Type++;
}
...
...
@@ -3893,12 +3893,22 @@ void Display_Sub(void)
if ( Display_Menu_Type != 0 )
Display_Menu_Type--;
}
uint8_t OTAMode;
uint8_t OTAModeBegin = 0;
uint32_t Get_Display_Type(void)
{
if(BlueTooth == 1)
{
return 3;
}
else if(OTAMode == 1)
{
return 4;
}
else if(OTAMode == 2)
{
return 5;
}
else
{
if(zhenduanflag == Data_Mode_Dot)
...
...
@@ -4865,22 +4875,22 @@ void Display_Version_Info(uint32_t ON_OFF)
}
TFT_LCD_Draw_Bmp(3, 90+25+25+30+30+30+5, ( uint8_t * )gImage_gImage_LEDwaif1X6_Y16 ); //硬线指示灯外发对比
TFT_LCD_Draw_Bmp(3, 90+25+25+30+25+30+30+5, ( uint8_t * )gImage_gImage_SV1X6_Y16 ); //软件版本号对比
//
TFT_LCD_Draw_Bmp(3, 90+25+25+30+25+30+30+5, ( uint8_t * )gImage_gImage_SV1X6_Y16 ); //软件版本号对比
// if((R485_ID4Dh.Sig.ESP322 != 0) && ( R485_ID4Dh.Sig.G0312 != 0))
// {
if((esp32houmian == 32) && (guominhoumian == 33) && (wifihoumian == 35))
{
TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30+30, ( uint8_t * )gImage_dui ); //软件版本号对比 对
jiaoyan = 1;
}
else
{
TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30+30, ( uint8_t * )gImage_cuo ); //软件版本号对比 错
jiaoyan = 0;
//正在调试取消版本号对比 想要取消版本号对比将上方注释掉并解开下方注释即可
// TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30+30, ( uint8_t * )gImage_dui ); //软件版本号对比 对
// firstpowerflag = 2;
}
//
if((esp32houmian == 32) && (guominhoumian == 33) && (wifihoumian == 35))
//
{
//
TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30+30, ( uint8_t * )gImage_dui ); //软件版本号对比 对
//
jiaoyan = 1;
//
}
//
else
//
{
//
TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30+30, ( uint8_t * )gImage_cuo ); //软件版本号对比 错
//
jiaoyan = 0;
//
//正在调试取消版本号对比 想要取消版本号对比将上方注释掉并解开下方注释即可
//
// TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30+30, ( uint8_t * )gImage_dui ); //软件版本号对比 对
//
// firstpowerflag = 2;
//
}
// }
// else
// {
...
...
@@ -4903,7 +4913,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,1,2,0,
3
,0xff};
uint8_t mbuff [7] = {2,5,1,2,0,
9
,0xff};
General_Number_Disp(mbuff, 160, 290);
}
...
...
YueJin_test_bench/source/Appliciation/Display_Info.h
View file @
fb7e1c2b
...
...
@@ -49,6 +49,8 @@ enum DisplayFont
extern
unsigned
int
Display_Menu_Type
;
extern
uint32_t
odo_val_Back
;
extern
uint8_t
OTAMode
;
extern
uint8_t
OTAModeBegin
;
void
GeneralInfoDisp
(
unsigned
char
*
p
,
unsigned
short
x
,
unsigned
short
y
);
void
Display_Title_Info
(
void
);
void
Display_Version_Info
(
uint32_t
ON_OFF
);
...
...
YueJin_test_bench/source/Appliciation/Key.c
View file @
fb7e1c2b
...
...
@@ -176,8 +176,8 @@ void Key_Init(void)
}
stKeyParameter
.
u16KeyLoosenTime
=
0U
;
stKeyParameter
.
u16KeyShortPressTime
=
20U
;
stKeyParameter
.
u16KeyLongPressTime
=
3
000U
;
stKeyParameter
.
u32KeySuperLongPressTime
=
9
0000U
;
stKeyParameter
.
u16KeyLongPressTime
=
2
000U
;
stKeyParameter
.
u32KeySuperLongPressTime
=
5
0000U
;
}
/*����Ӳ�߰������ԣ��ж϶̰���ʱ�����*/
Key_Set_en_t
Key_Parameter_Set_Short_Press_Time
(
uint16_t
u16Time
)
...
...
YueJin_test_bench/source/Appliciation/Key.h
View file @
fb7e1c2b
...
...
@@ -83,6 +83,7 @@ extern void confirmkeyserve(void);
extern
void
upkeyserve
(
void
);
extern
void
downkeyserve
(
void
);
extern
void
PasswordUnlock
(
void
);
extern
void
OpenOTASercice
(
void
);
extern
Key_Set_en_t
Key_Parameter_Set_Short_Press_Time
(
uint16_t
u16Time
);
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
);
...
...
YueJin_test_bench/source/Appliciation/Key_user.c
View file @
fb7e1c2b
...
...
@@ -124,14 +124,17 @@ void Key_Operation_SW8(Key_Event_en_t enKeyEvent)
{
}
}
void
Key_Operation_SW9
(
Key_Event_en_t
enKeyEvent
)
//下移位
void
Key_Operation_SW9
(
Key_Event_en_t
enKeyEvent
)
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
//下移位
{
downkeyflag
=
1
;
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
//P2P模式
{
OTAMode
=
2
;
name1
=
(
devicename
)
&
0xFF
;
name2
=
(
devicename
>>
8
)
&
0xFF
;
}
else
if
(
enKeyEvent
==
KEY_EVENT_SUPER_LONG_PRESS
)
{
...
...
@@ -197,15 +200,17 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent)
{
}
}
void
Key_Operation_SW1
(
Key_Event_en_t
enKeyEvent
)
//上移位
void
Key_Operation_SW1
(
Key_Event_en_t
enKeyEvent
)
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
//上移位
{
upkeyflag
=
1
;
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
//AP模式
{
OTAMode
=
1
;
name1
=
(
devicename
)
&
0xFF
;
name2
=
(
devicename
>>
8
)
&
0xFF
;
}
else
if
(
enKeyEvent
==
KEY_EVENT_SUPER_LONG_PRESS
)
{
...
...
@@ -355,6 +360,39 @@ void PasswordUnlock(void)
KeyStep
=
0
;
}
}
uint8_t
OpenOTATime
;
void
OpenOTASercice
(
void
)
{
if
(((
OTAMode
!=
1
)
&&
(
OTAMode
!=
2
))
||
(
OTAModeBegin
!=
1
))
{
return
;
}
if
(
OpenOTATime
>
240
)
{
OTAMode
=
0
;
OpenOTATime
=
0
;
OTAModeBegin
=
0
;
OTAModeBeginTime
=
0
;
return
;
}
OpenOTATime
++
;
if
(
OpenOTATime
<=
120
)
{
Press_to_up
=
((
OpenOTATime
/
10
)
%
2
)
==
0
?
1
:
0
;
Press_to_down
=
0
;
}
else
{
uint16_t
relativeTime
=
OpenOTATime
-
120
;
Press_to_down
=
((
relativeTime
/
10
)
%
2
)
==
0
?
1
:
0
;
Press_to_up
=
0
;
}
}
/*-------------------------------------------------*/
Key_Real_Status_en_t
Key_Real_sw5
(
void
)
{
...
...
YueJin_test_bench/source/Appliciation/Task.c
View file @
fb7e1c2b
...
...
@@ -59,6 +59,7 @@ void Sys_Run_Mode_2ms_Tasks_Group(void)
{
RTE_ADC_Services
(
);
Get_static_Current
();
Bluetoothname
();
}
/*==============================================================================
...
...
@@ -75,8 +76,8 @@ void Sys_Run_Mode_5ms_Tasks_Group(void)
void
Sys_Run_Mode_10ms_Tasks_Group
(
void
)
{
Key_Service
();
Bluetoothnam
e
();
if
(
clearOdoFlag
==
0
)
OpenOTASercic
e
();
if
(
(
clearOdoFlag
==
0
)
&&
(
OTAMode
!=
1
)
&&
(
OTAMode
!=
2
)
)
{
confirmkeyserve
();
upkeyserve
();
...
...
@@ -112,9 +113,21 @@ uint8_t flashtime = 0;
uint8_t
showtime
=
0
;
uint8_t
bleuarttime
=
0
;
uint8_t
querendelay
=
0
;
uint8_t
OTAModeBeginTime
;
void
Sys_Run_Mode_100ms_Tasks_Group
(
void
)
{
if
((
OTAMode
==
1
)
||
(
OTAMode
==
2
))
{
if
(
OTAModeBeginTime
<=
150
)
{
OTAModeBeginTime
++
;
}
else
{
OTAModeBegin
=
1
;
}
}
ProcessBluetoothDeviceNameWithLock
();
AutoClearCounterAfterAllLit
();
TimeDelay_3s
();
...
...
YueJin_test_bench/source/Appliciation/Task.h
View file @
fb7e1c2b
...
...
@@ -8,6 +8,7 @@ extern uint32_t devicename;
extern
uint8_t
upkeyflag
;
extern
uint8_t
downkeyflag
;
extern
uint8_t
Confirmkeyflag
;
extern
uint8_t
OTAModeBeginTime
;
// extern uint8_t Openble[20];
void
Sys_Run_Mode_Pseudo_Real_Time_Tasks
(
void
);
void
Sys_Run_Mode_2ms_Tasks_Group
(
void
);
...
...
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