Skip to content

Commit 4fd7c1a

Browse files
committed
tools, pyboard.py: Write data to pyboard in chunks of 256 bytes.
This speeds up writes significantly.
1 parent 2870d85 commit 4fd7c1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/pyboard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def exec_raw(self, command, timeout=10, data_consumer=None):
104104
command_bytes = bytes(command, encoding='ascii')
105105

106106
# write command
107-
for i in range(0, len(command_bytes), 32):
108-
self.serial.write(command_bytes[i:min(i+32, len(command_bytes))])
107+
for i in range(0, len(command_bytes), 256):
108+
self.serial.write(command_bytes[i:min(i + 256, len(command_bytes))])
109109
time.sleep(0.01)
110110
self.serial.write(b'\x04')
111111

0 commit comments

Comments
 (0)