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
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
5 years ago
by
Stefan Haun
Browse files
Options
Downloads
Patches
Plain Diff
Make theme buttons responsive again
parent
44f605af
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#3421
passed
5 years ago
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:
def
loop
(
self
):
colored
=
False
button_pressed
=
False
update_counter
=
0
new_theme
=
self
.
theme
while
True
:
try
:
with
display
.
open
()
as
disp
:
if
update_counter
==
0
:
update_counter
=
10
with
display
.
open
()
as
disp
:
# update the display
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
:
break
...
...
@@ -195,16 +208,15 @@ class Clock:
if
not
button_pressed
and
v
&
buttons
.
BOTTOM_LEFT
!=
0
:
button_pressed
=
True
self
.
setTheme
(
self
.
theme
-
1
)
self
.
writeConfig
()
new_theme
=
self
.
theme
-
1
elif
not
button_pressed
and
v
&
buttons
.
BOTTOM_RIGHT
!=
0
:
button_pressed
=
True
self
.
setTheme
(
self
.
theme
+
1
)
self
.
writeConfig
()
new_theme
=
self
.
theme
+
1
utime
.
sleep_ms
(
25
0
)
utime
.
sleep_ms
(
25
)
except
OSError
:
# leds.set(1, (255, 0, 0))
pass
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