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
cda0d125
Commit
cda0d125
authored
1 year ago
by
q3k
Browse files
Options
Downloads
Patches
Plain Diff
st4m: run against new captouch api
parent
4b044849
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
python_payload/mypystubs/captouch.pyi
+1
-1
1 addition, 1 deletion
python_payload/mypystubs/captouch.pyi
python_payload/st4m/goose.py
+4
-2
4 additions, 2 deletions
python_payload/st4m/goose.py
python_payload/st4m/input.py
+3
-1
3 additions, 1 deletion
python_payload/st4m/input.py
with
8 additions
and
4 deletions
python_payload/mypystubs/captouch.pyi
+
1
−
1
View file @
cda0d125
from
typing
import
Protocol
,
List
from
typing
import
Protocol
,
List
,
Tuple
class
CaptouchPetalPadsState
(
Protocol
):
"""
...
...
This diff is collapsed.
Click to expand it.
python_payload/st4m/goose.py
+
4
−
2
View file @
cda0d125
...
...
@@ -17,7 +17,7 @@ if TYPE_CHECKING:
class
ABCBase
(
metaclass
=
ABCMeta
):
pass
from
typing
import
List
,
Optional
from
typing
import
List
,
Optional
,
Tuple
from
enum
import
Enum
else
:
# We're in CPython or Micropython.
...
...
@@ -31,12 +31,13 @@ else:
return
_fail
try
:
from
typing
import
List
,
Optional
from
typing
import
List
,
Optional
,
Tuple
from
enum
import
Enum
except
ImportError
:
# We're in Micropython.
List
=
None
Optional
=
None
Tuple
=
None
class
Enum
:
pass
...
...
@@ -49,4 +50,5 @@ __all__ = [
"
List
"
,
"
Optional
"
,
"
Enum
"
,
"
Tuple
"
,
]
This diff is collapsed.
Click to expand it.
python_payload/st4m/input.py
+
3
−
1
View file @
cda0d125
...
...
@@ -2,6 +2,7 @@ from st4m.goose import List, Optional, Enum
from
st4m.ui.ctx
import
Ctx
import
hardware
import
captouch
class
InputState
:
...
...
@@ -25,7 +26,8 @@ class InputState:
Build InputState from current hardware state. Should only be used by the
Reactor.
"""
petal_pressed
=
[
hardware
.
get_captouch
(
i
)
for
i
in
range
(
10
)]
cts
=
captouch
.
read
()
petal_pressed
=
[
cts
.
petals
[
i
].
pressed
for
i
in
range
(
10
)]
left_button
=
hardware
.
left_button_get
()
right_button
=
hardware
.
right_button_get
()
...
...
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