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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefan Haun
firmware
Commits
854735a8
Commit
854735a8
authored
Aug 24, 2019
by
Stefan Haun
Browse files
Options
Downloads
Patches
Plain Diff
Make theme buttons responsive again
parent
44f605af
No related branches found
No related tags found
No related merge requests found
Pipeline
#3421
passed
Aug 24, 2019
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
preload/main.py
+29
-17
29 additions, 17 deletions
preload/main.py
with
29 additions
and
17 deletions
preload/main.py
+
29
−
17
View file @
854735a8
...
@@ -180,11 +180,24 @@ class Clock:
...
@@ -180,11 +180,24 @@ class Clock:
def
loop
(
self
):
def
loop
(
self
):
colored
=
False
colored
=
False
button_pressed
=
False
button_pressed
=
False
update_counter
=
0
new_theme
=
self
.
theme
while
True
:
while
True
:
try
:
try
:
with
display
.
open
()
as
disp
:
if
update_counter
==
0
:
update_counter
=
10
with
display
.
open
()
as
disp
:
# update the display
self
.
updateClock
(
disp
)
self
.
updateClock
(
disp
)
# check theme
if
new_theme
!=
self
.
theme
:
self
.
setTheme
(
new_theme
)
self
.
writeConfig
()
update_counter
=
update_counter
-
1
if
self
.
run_once
:
if
self
.
run_once
:
break
break
...
@@ -195,16 +208,15 @@ class Clock:
...
@@ -195,16 +208,15 @@ class Clock:
if
not
button_pressed
and
v
&
buttons
.
BOTTOM_LEFT
!=
0
:
if
not
button_pressed
and
v
&
buttons
.
BOTTOM_LEFT
!=
0
:
button_pressed
=
True
button_pressed
=
True
self
.
setTheme
(
self
.
theme
-
1
)
new_theme
=
self
.
theme
-
1
self
.
writeConfig
()
elif
not
button_pressed
and
v
&
buttons
.
BOTTOM_RIGHT
!=
0
:
elif
not
button_pressed
and
v
&
buttons
.
BOTTOM_RIGHT
!=
0
:
button_pressed
=
True
button_pressed
=
True
self
.
setTheme
(
self
.
theme
+
1
)
new_theme
=
self
.
theme
+
1
self
.
writeConfig
()
utime
.
sleep_ms
(
25
0
)
utime
.
sleep_ms
(
25
)
except
OSError
:
except
OSError
:
# leds.set(1, (255, 0, 0))
pass
pass
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
...
...
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