tools/mpremote: Add ioctl to specify large read buffer size.

Speeds up importing files from mounted filesystem.

Also fix the return code for invalid / unsupported ioctl requests.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
pull/12836/head
Andrew Leech 2023-11-01 15:14:37 +11:00 zatwierdzone przez Damien George
rodzic 4cf741062b
commit bbc5a18d09
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -753,6 +753,13 @@ class RemoteFile(io.IOBase):
machine.mem32[arg] = self.seek(machine.mem32[arg], machine.mem32[arg + 4])
elif request == 4: # CLOSE
self.close()
elif request == 11: # BUFFER_SIZE
# This is used as the vfs_reader buffer. n + 4 should be less than 255 to
# fit in stdin ringbuffer on supported ports. n + 7 should be multiple of 16
# to efficiently use gc blocks in mp_reader_vfs_t.
return 249
else:
return -1
return 0
def flush(self):