Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
d1cd9ce1
Commit
d1cd9ce1
authored
4 years ago
by
Pixtxa
Browse files
Options
Downloads
Patches
Plain Diff
Try loading default values from config
parent
7be1aded
No related branches found
No related tags found
1 merge request
!433
Simple Menu
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pycardium/modules/py/simple_menu.py
+15
-2
15 additions, 2 deletions
pycardium/modules/py/simple_menu.py
with
15 additions
and
2 deletions
pycardium/modules/py/simple_menu.py
+
15
−
2
View file @
d1cd9ce1
...
...
@@ -6,9 +6,22 @@ import time
import
config
TIMEOUT
=
0x100
LONG_PRESS_MS
=
1000
RETRIGGER_MS
=
250
try
:
LONG_PRESS_MS
=
int
(
config
.
get_string
(
"
long_press_ms
"
))
except
OSError
:
pass
try
:
RETRIGGER_MS
=
int
(
config
.
get_string
(
"
retrigger_ms
"
))
except
OSError
:
pass
"""
:py:func:`~simple_menu.button_events` timeout marker.
"""
def
button_events
(
timeout
=
None
,
long_press_ms
=
1000
,
retrigger_ms
=
250
):
def
button_events
(
timeout
=
None
,
long_press_ms
=
LONG_PRESS_MS
,
retrigger_ms
=
RETRIGGER_MS
):
"""
Iterate over button presses (event-loop).
...
...
@@ -316,7 +329,7 @@ class Menu:
self
.
disp
.
update
()
def
run
(
self
,
long_press_ms
=
1000
,
retrigger_ms
=
250
):
def
run
(
self
,
long_press_ms
=
LONG_PRESS_MS
,
retrigger_ms
=
RETRIGGER_MS
):
"""
Start the event-loop.
"""
try
:
timeout
=
self
.
scroll_speed
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment