Skip to content
Snippets Groups Projects
Commit 9c9db3a7 authored by Damien George's avatar Damien George
Browse files

tools, pyboard.py: Allow exec argument to be bytes or str.

parent 1a55b6a7
No related branches found
No related tags found
No related merge requests found
...@@ -71,6 +71,9 @@ class Pyboard: ...@@ -71,6 +71,9 @@ class Pyboard:
return ret return ret
def exec(self, command): def exec(self, command):
if isinstance(command, bytes):
command_bytes = command
else:
command_bytes = bytes(command, encoding='ascii') command_bytes = bytes(command, encoding='ascii')
for i in range(0, len(command_bytes), 32): for i in range(0, len(command_bytes), 32):
self.serial.write(command_bytes[i:min(i+32, len(command_bytes))]) self.serial.write(command_bytes[i:min(i+32, len(command_bytes))])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment