Browse Source

tools/mpremote: Implement seek and flush in ioctl method.

Fixes issue #8058.

Signed-off-by: Damien George <damien@micropython.org>
pull/8061/head
Damien George 3 years ago
parent
commit
67f66795c0
  1. 8
      tools/mpremote/mpremote/pyboardextended.py

8
tools/mpremote/mpremote/pyboardextended.py

@ -142,7 +142,13 @@ class RemoteFile(uio.IOBase):
self.close() self.close()
def ioctl(self, request, arg): def ioctl(self, request, arg):
if request == 4: # CLOSE if request == 1: # FLUSH
self.flush()
elif request == 2: # SEEK
# This assumes a 32-bit bare-metal machine.
import machine
machine.mem32[arg] = self.seek(machine.mem32[arg], machine.mem32[arg + 4])
elif request == 4: # CLOSE
self.close() self.close()
return 0 return 0

Loading…
Cancel
Save