Skip to content

Commit

Permalink
Call os.sync to make UART transfer more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
dhylands committed Jun 19, 2019
1 parent 43f191e commit f38a350
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions rshell/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ def recv_file_from_host(src_file, dst_filename, filesize, dst_mode='wb'):
"""Function which runs on the pyboard. Matches up with send_file_to_remote."""
import sys
import ubinascii
import os
if HAS_BUFFER:
try:
import pyb
Expand Down Expand Up @@ -1011,6 +1012,8 @@ def recv_file_from_host(src_file, dst_filename, filesize, dst_mode='wb'):
dst_file.write(write_buf[0:read_size])
else:
dst_file.write(ubinascii.unhexlify(write_buf[0:read_size]))
if hasattr(os, 'sync'):
os.sync()
bytes_remaining -= read_size
return True
except:
Expand Down
2 changes: 1 addition & 1 deletion rshell/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.0.25'
__version__ = '0.0.26'

0 comments on commit f38a350

Please sign in to comment.