Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
9c9db3a7
Commit
9c9db3a7
authored
Oct 19, 2014
by
Damien George
Browse files
tools, pyboard.py: Allow exec argument to be bytes or str.
parent
1a55b6a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/pyboard.py
View file @
9c9db3a7
...
...
@@ -71,7 +71,10 @@ class Pyboard:
return
ret
def
exec
(
self
,
command
):
command_bytes
=
bytes
(
command
,
encoding
=
'ascii'
)
if
isinstance
(
command
,
bytes
):
command_bytes
=
command
else
:
command_bytes
=
bytes
(
command
,
encoding
=
'ascii'
)
for
i
in
range
(
0
,
len
(
command_bytes
),
32
):
self
.
serial
.
write
(
command_bytes
[
i
:
min
(
i
+
32
,
len
(
command_bytes
))])
time
.
sleep
(
0.01
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment