micropython/ports/rp2/modules/_boot_fat.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
275 B
Python
Raw Normal View History

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