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
3144d079
Commit
3144d079
authored
1 year ago
by
dx
Committed by
q3k
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
rename foreground global var to CURRENT_APP_RUN
parent
552ae78a
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
+8
-8
8 additions, 8 deletions
python_payload/main.py
with
8 additions
and
8 deletions
python_payload/main.py
+
8
−
8
View file @
3144d079
...
@@ -14,7 +14,7 @@ BOOTSEL_PIN = Pin(0, Pin.IN)
...
@@ -14,7 +14,7 @@ BOOTSEL_PIN = Pin(0, Pin.IN)
VOL_UP_PIN
=
Pin
(
35
,
Pin
.
IN
,
Pin
.
PULL_UP
)
VOL_UP_PIN
=
Pin
(
35
,
Pin
.
IN
,
Pin
.
PULL_UP
)
VOL_DOWN_PIN
=
Pin
(
37
,
Pin
.
IN
,
Pin
.
PULL_UP
)
VOL_DOWN_PIN
=
Pin
(
37
,
Pin
.
IN
,
Pin
.
PULL_UP
)
foreground
=
0
CURRENT_APP_RUN
=
None
VOLUME
=
0
VOLUME
=
0
SELECT_TEXT
=
[
SELECT_TEXT
=
[
...
@@ -36,7 +36,7 @@ BACKGROUND_COLOR = 0
...
@@ -36,7 +36,7 @@ BACKGROUND_COLOR = 0
# 0 (bootsel) probably not but idk? never tried
# 0 (bootsel) probably not but idk? never tried
def
run_menu
():
def
run_menu
():
global
foreground
global
CURRENT_APP_RUN
display_fill
(
BACKGROUND_COLOR
)
display_fill
(
BACKGROUND_COLOR
)
utils
.
draw_text_big
(
SELECT_TEXT
,
0
,
0
)
utils
.
draw_text_big
(
SELECT_TEXT
,
0
,
0
)
utils
.
draw_volume_slider
(
VOLUME
)
utils
.
draw_volume_slider
(
VOLUME
)
...
@@ -55,7 +55,7 @@ def run_menu():
...
@@ -55,7 +55,7 @@ def run_menu():
utils
.
highlight_bottom_petal
(
selected_petal
,
55
,
0
,
0
)
utils
.
highlight_bottom_petal
(
selected_petal
,
55
,
0
,
0
)
display_fill
(
BACKGROUND_COLOR
)
display_fill
(
BACKGROUND_COLOR
)
display_update
()
display_update
()
foreground
=
selected_module
.
run
CURRENT_APP_RUN
=
selected_module
.
run
time
.
sleep_ms
(
100
)
time
.
sleep_ms
(
100
)
utils
.
clear_all_leds
()
utils
.
clear_all_leds
()
selected_module
.
foreground
()
selected_module
.
foreground
()
...
@@ -83,28 +83,28 @@ def set_rel_volume(vol):
...
@@ -83,28 +83,28 @@ def set_rel_volume(vol):
time
.
sleep_ms
(
100
)
time
.
sleep_ms
(
100
)
def
main
():
def
main
():
global
foreground
global
CURRENT_APP_RUN
time
.
sleep_ms
(
5000
)
time
.
sleep_ms
(
5000
)
captouch_autocalib
()
captouch_autocalib
()
for
module
in
MODULES
:
for
module
in
MODULES
:
module
.
init
()
module
.
init
()
foreground
=
run_menu
CURRENT_APP_RUN
=
run_menu
foreground_menu
()
foreground_menu
()
set_global_volume_dB
(
VOLUME
)
set_global_volume_dB
(
VOLUME
)
while
True
:
while
True
:
if
(
BOOTSEL_PIN
.
value
()
==
0
):
if
(
BOOTSEL_PIN
.
value
()
==
0
):
if
foreground
==
run_menu
:
if
CURRENT_APP_RUN
==
run_menu
:
captouch_autocalib
()
captouch_autocalib
()
else
:
else
:
foreground
=
run_menu
CURRENT_APP_RUN
=
run_menu
foreground_menu
()
foreground_menu
()
if
(
VOL_UP_PIN
.
value
()
==
0
):
if
(
VOL_UP_PIN
.
value
()
==
0
):
set_rel_volume
(
+
3
)
set_rel_volume
(
+
3
)
if
(
VOL_DOWN_PIN
.
value
()
==
0
):
if
(
VOL_DOWN_PIN
.
value
()
==
0
):
set_rel_volume
(
-
3
)
set_rel_volume
(
-
3
)
foreground
()
CURRENT_APP_RUN
()
main
()
main
()
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