circuitpython/ports/rp2/modules/_boot_fat.py
iabdalkader 507ad03329 rp2: Add USB MSC support.
It is currently not enabled by default on any board.
2022-03-09 00:38:07 +11:00

16 lines
275 B
Python

import os
import machine, rp2
# Try to mount the filesystem, and format the flash if it doesn't exist.
bdev = rp2.Flash()
try:
vfs = os.VfsFat(bdev)
os.mount(vfs, "/")
except:
os.VfsFat.mkfs(bdev)
vfs = os.VfsFat(bdev)
os.mount(vfs, "/")
del os, bdev, vfs