Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dos
flow3r firmware
Commits
3fcb642f
Commit
3fcb642f
authored
1 year ago
by
dx
Committed by
q3k
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
python: list of MODULES for menu
parent
04eaabb8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_payload/main.py
+20
-15
20 additions, 15 deletions
python_payload/main.py
with
20 additions
and
15 deletions
python_payload/main.py
+
20
−
15
View file @
3fcb642f
...
...
@@ -4,6 +4,11 @@ import time
import
cap_touch_demo
import
melodic_demo
MODULES
=
[
cap_touch_demo
,
melodic_demo
,
]
boot
=
Pin
(
0
,
Pin
.
IN
)
vol_up
=
Pin
(
35
,
Pin
.
IN
,
Pin
.
PULL_UP
)
vol_down
=
Pin
(
37
,
Pin
.
IN
,
Pin
.
PULL_UP
)
...
...
@@ -86,24 +91,23 @@ def run_menu():
draw_volume_slider
()
display_update
()
if
long_bottom_petal_captouch_blocking
(
0
,
20
):
clear_all_leds
()
highlight_bottom_petal
(
0
,
55
,
0
,
0
)
display_fill
(
background
)
display_update
()
foreground
=
cap_touch_demo
.
run
time
.
sleep_ms
(
100
)
clear_all_leds
()
cap_touch_demo
.
foreground
()
if
long_bottom_petal_captouch_blocking
(
1
,
20
):
selected_petal
=
None
selected_module
=
None
for
petal
,
module
in
enumerate
(
MODULES
):
if
long_bottom_petal_captouch_blocking
(
petal
,
20
):
selected_petal
=
petal
selected_module
=
module
break
if
selected_petal
is
not
None
:
clear_all_leds
()
highlight_bottom_petal
(
1
,
55
,
0
,
0
)
highlight_bottom_petal
(
selected_petal
,
55
,
0
,
0
)
display_fill
(
background
)
display_update
()
foreground
=
m
el
odic_demo
.
run
foreground
=
s
el
ected_module
.
run
time
.
sleep_ms
(
100
)
clear_all_leds
()
m
el
odic_demo
.
foreground
()
s
el
ected_module
.
foreground
()
def
foreground_menu
():
clear_all_leds
()
...
...
@@ -131,8 +135,9 @@ def main():
global
foreground
time
.
sleep_ms
(
5000
)
captouch_autocalib
()
cap_touch_demo
.
init
()
melodic_demo
.
init
()
for
module
in
MODULES
:
module
.
init
()
foreground
=
run_menu
foreground_menu
()
...
...
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