tools, pyboard.py: Write data to pyboard in chunks of 256 bytes.

This speeds up writes significantly.
This commit is contained in:
Damien George 2014-12-20 18:09:04 +00:00
parent 2870d85a11
commit 4fd7c1a2ac

View File

@ -104,8 +104,8 @@ class Pyboard:
command_bytes = bytes(command, encoding='ascii')
# write command
for i in range(0, len(command_bytes), 32):
self.serial.write(command_bytes[i:min(i+32, len(command_bytes))])
for i in range(0, len(command_bytes), 256):
self.serial.write(command_bytes[i:min(i + 256, len(command_bytes))])
time.sleep(0.01)
self.serial.write(b'\x04')