Skip to content

Commit e7abc00

Browse files
committed
rp2/modules: Fix FatFS boot script.
This change helps detect if the filesystem is invalid and reformat the FAT if needed. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent 09d070a commit e7abc00

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ports/rp2/modules/_boot_fat.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
# Try to mount the filesystem, and format the flash if it doesn't exist.
66
bdev = rp2.Flash()
77
try:
8-
fs = vfs.VfsFat(bdev)
8+
vfs.mount(vfs.VfsFat(bdev), "/")
99
except:
1010
vfs.VfsFat.mkfs(bdev)
11-
fs = vfs.VfsFat(bdev)
12-
vfs.mount(fs, "/")
11+
vfs.mount(vfs.VfsFat(bdev), "/")
1312

14-
del vfs, bdev, fs
13+
del vfs, bdev

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy