aboutsummaryrefslogtreecommitdiff
path: root/projects/cli-test
diff options
context:
space:
mode:
authorFredrik Thulin <fredrik@thulin.net>2016-05-16 16:03:39 +0200
committerFredrik Thulin <fredrik@thulin.net>2016-05-16 16:03:39 +0200
commit5290f45cb66c8021645a5024613eca0a70121226 (patch)
tree221e7d78ee15cc1ddaa207cc26c610e8a00d9559 /projects/cli-test
parent4c1eff0373b7a4a0072fc7515352139cd9d6d02f (diff)
Use baud rate 921600 instead of 115200.
Don't want to wait longer than necessary for firmware file transfers.
Diffstat (limited to 'projects/cli-test')
-rwxr-xr-xprojects/cli-test/filetransfer6
1 files changed, 4 insertions, 2 deletions
diff --git a/projects/cli-test/filetransfer b/projects/cli-test/filetransfer
index 92b117f..451a1d9 100755
--- a/projects/cli-test/filetransfer
+++ b/projects/cli-test/filetransfer
@@ -10,7 +10,9 @@ from binascii import crc32
def _write(dst, data):
- dst.write(data)
+ for i in range(len(data)):
+ dst.write(data[i])
+ time.sleep(0.1)
if len(data) == 4:
print("Wrote 0x{:02x}{:02x}{:02x}{:02x}".format(ord(data[0]), ord(data[1]), ord(data[2]), ord(data[3])))
else:
@@ -49,7 +51,7 @@ def send_file(filename, device='/dev/ttyUSB0', initiate=True):
size = s.st_size
src = open(filename, 'rb')
- dst = serial.Serial(device, 115200, timeout=0.5)
+ dst = serial.Serial(device, 921600, timeout=1)
if initiate:
response = _execute(dst, 'filetransfer')