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
ee5117af
Commit
ee5117af
authored
Sep 25, 2025
by
何锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:增加仪表数字按键控制
parent
96c4c0e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
21 deletions
+38
-21
Key.h
YueJin_test_bench/source/Appliciation/Key.h
+1
-0
Key_user.c
YueJin_test_bench/source/Appliciation/Key_user.c
+37
-21
No files found.
YueJin_test_bench/source/Appliciation/Key.h
View file @
ee5117af
...
@@ -14,6 +14,7 @@ typedef enum
...
@@ -14,6 +14,7 @@ typedef enum
KEY_11
,
KEY_11
,
KEY_3
,
KEY_3
,
KEY_1
,
KEY_1
,
KEY_4
,
KEY_NUM_MAX
,
KEY_NUM_MAX
,
}
Key_Num_en_t
;
}
Key_Num_en_t
;
...
...
YueJin_test_bench/source/Appliciation/Key_user.c
View file @
ee5117af
...
@@ -120,6 +120,23 @@ void Key_Operation_SW8(Key_Event_en_t enKeyEvent)
...
@@ -120,6 +120,23 @@ void Key_Operation_SW8(Key_Event_en_t enKeyEvent)
{
{
}
}
}
}
void
Key_Operation_SW9
(
Key_Event_en_t
enKeyEvent
)
//下移位
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
downkeyflag
=
1
;
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
}
else
if
(
enKeyEvent
==
KEY_EVENT_SUPER_LONG_PRESS
)
{
}
else
{
}
}
void
Key_Operation_SW2
(
Key_Event_en_t
enKeyEvent
)
void
Key_Operation_SW2
(
Key_Event_en_t
enKeyEvent
)
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
...
@@ -192,44 +209,31 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent)
...
@@ -192,44 +209,31 @@ 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
)
//
上移位
{
{
/*清零ODO*/
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
{
if
(
firstpowerflag
==
2
)
upkeyflag
=
1
;
{
if
(
Auto_ONOFF
!=
0
)
{
Auto_ONOFF
=
0
;
}
else
{
Auto_ONOFF
=
1
;
}
}
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
{
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_SUPER_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_SUPER_LONG_PRESS
)
{
{
if
(
Get_Display_Type
(
)
==
2
)
{
MENU_CHECK_STEP_ADD
(
);
}
}
}
else
else
{
{
}
}
}
}
void
Key_Operation_SW6
(
Key_Event_en_t
enKeyEvent
)
void
Key_Operation_SW6
(
Key_Event_en_t
enKeyEvent
)
//确认键
{
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
{
Confirmkeyflag
=
1
;
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
{
...
@@ -297,6 +301,17 @@ Key_Real_Status_en_t Key_Real_sw8(void)
...
@@ -297,6 +301,17 @@ Key_Real_Status_en_t Key_Real_sw8(void)
}
}
return
enKeyRealStatus
;
return
enKeyRealStatus
;
}
}
Key_Real_Status_en_t
Key_Real_sw9
(
void
)
{
Key_Real_Status_en_t
enKeyRealStatus
=
KEY_LINE_LOOSEN
;
if
(
SW9
==
0U
)
{
enKeyRealStatus
=
KEY_LINE_PRESS
;
}
return
enKeyRealStatus
;
}
Key_Real_Status_en_t
Key_Real_sw2
(
void
)
Key_Real_Status_en_t
Key_Real_sw2
(
void
)
{
{
...
@@ -349,7 +364,7 @@ Key_Real_Status_en_t Key_Real_sw6(void)
...
@@ -349,7 +364,7 @@ Key_Real_Status_en_t Key_Real_sw6(void)
Key_Real_Status_en_t
enKeyRealStatus
=
KEY_LINE_LOOSEN
;
Key_Real_Status_en_t
enKeyRealStatus
=
KEY_LINE_LOOSEN
;
if
(
SW
9
==
0U
)
if
(
SW
6
==
0U
)
{
{
enKeyRealStatus
=
KEY_LINE_PRESS
;
enKeyRealStatus
=
KEY_LINE_PRESS
;
}
}
...
@@ -392,4 +407,5 @@ const Key_Attribute_st_t stKeyAttribute [ KEY_NUM_MAX ] = {
...
@@ -392,4 +407,5 @@ const Key_Attribute_st_t stKeyAttribute [ KEY_NUM_MAX ] = {
{
KEY_TYPE_LINE
,
Key_Real_sw10
,
Key_Operation_SW10
},
{
KEY_TYPE_LINE
,
Key_Real_sw10
,
Key_Operation_SW10
},
{
KEY_TYPE_LINE
,
Key_Real_sw3
,
Key_Operation_SW3
},
//SW1+
{
KEY_TYPE_LINE
,
Key_Real_sw3
,
Key_Operation_SW3
},
//SW1+
{
KEY_TYPE_LINE
,
Key_Real_sw6
,
Key_Operation_SW6
},
//SW1+
{
KEY_TYPE_LINE
,
Key_Real_sw6
,
Key_Operation_SW6
},
//SW1+
{
KEY_TYPE_LINE
,
Key_Real_sw9
,
Key_Operation_SW9
},
//SW1+
};
};
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