Merge pull request #11 from dhalbert/buffered-writes
Write in chunks of 20 bytes or less
This commit is contained in:
commit
04c84be2a3
1 changed files with 5 additions and 1 deletions
|
|
@ -125,4 +125,8 @@ class UARTServer:
|
|||
|
||||
def write(self, buf):
|
||||
"""Write a buffer of bytes."""
|
||||
self._nus_tx_char.value = buf
|
||||
# We can only write 20 bytes at a time.
|
||||
offset = 0
|
||||
while offset < len(buf):
|
||||
self._nus_tx_char.value = buf[offset:offset+20]
|
||||
offset += 20
|
||||
|
|
|
|||
Loading…
Reference in a new issue