MCPcopy Create free account
hub / github.com/RetiredWizard/PyDOS / ioctl

Method ioctl

mpython/extFlash/lib/flashbdev.py:38–45  ·  view source on GitHub ↗
(self, op, arg)

Source from the content-addressed store, hash-verified

36 self.flash.flash_write(n * self.sectorsize + offset, buf)
37
38 def ioctl(self, op, arg):
39 if op == 4: # MP_BLOCKDEV_IOCTL_BLOCK_COUNT
40 return self.flash.flash_size() // self.sectorsize
41 if op == 5: # MP_BLOCKDEV_IOCTL_BLOCK_SIZE
42 return self.sectorsize
43 if op == 6: # MP_BLOCKDEV_IOCTL_BLOCK_ERASE
44 self.flash.flash_erase(arg * self.sectorsize)
45 return 0

Callers

nothing calls this directly

Calls 2

flash_sizeMethod · 0.80
flash_eraseMethod · 0.80

Tested by

no test coverage detected