ports: Use vfs module instead of os.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2023-11-22 16:24:10 +11:00
parent b87bbaeb43
commit 7d28789544
13 changed files with 58 additions and 58 deletions

View File

@@ -20,7 +20,7 @@ Direct wiring on SD card (SPI):
---------------------------------
"""
import os
import os, vfs
from machine import SPI, Pin
from sdcard import SDCard
@@ -28,7 +28,7 @@ from sdcard import SDCard
def mnt():
cs = Pin("P22", mode=Pin.OUT)
sd = SDCard(SPI(0), cs)
os.mount(sd, "/")
vfs.mount(sd, "/")
def list():

View File

@@ -44,7 +44,7 @@ Example usage of SD card reader:
tf = mount_tf()
os.listdir()
"""
import os
import vfs
import time
import framebuf
@@ -54,7 +54,7 @@ from sdcard import SDCard
def mount_tf(self, mount_point="/"):
sd = SDCard(SPI(0), Pin("P15", mode=Pin.OUT))
os.mount(sd, mount_point)
vfs.mount(sd, mount_point)
class ILI9341:

View File

@@ -1,19 +1,19 @@
import os, nrf
import vfs, nrf
try:
from os import VfsLfs1
from vfs import VfsLfs1
os.VfsLfs1.mkfs(nrf.Flash())
vfs.VfsLfs1.mkfs(nrf.Flash())
except ImportError:
try:
from os import VfsLfs2
from vfs import VfsLfs2
os.VfsLfs2.mkfs(nrf.Flash())
vfs.VfsLfs2.mkfs(nrf.Flash())
except ImportError:
try:
from os import VfsFat
from vfs import VfsFat
os.VfsFat.mkfs(nrf.Flash())
vfs.VfsFat.mkfs(nrf.Flash())
except ImportError:
pass
except OSError as e: