8000 tools/mpremote: Add ioctl to specify large read buffer size. · ArduinoTM/micropython@bbc5a18 · GitHub
[go: up one dir, main page]

Skip to content

Commit bbc5a18

Browse files
pi-anldpgeorge
authored andcommitted
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>
1 parent 4cf7410 commit bbc5a18

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/mpremote/mpremote/transport_serial.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,13 @@ def ioctl(self, request, arg):
753753
machine.mem32[arg] = self.seek(machine.mem32[arg], machine.mem32[arg + 4])
754754
elif request == 4: # CLOSE
755755
self.close()
756+
elif request == 11: # BUFFER_SIZE
757+
# This is used as the vfs_reader buffer. n + 4 should be less than 255 to
758+
# fit in stdin ringbuffer on supported ports. n + 7 should be multiple of 16
759+
# to efficiently use gc blocks in mp_reader_vfs_t.
760+
return 249
761+
else:
762+
return -1
756763
return 0
757764
758765
def flush(self):

0 commit comments

Comments
 (0)
0